LoginSignup
0
3

More than 5 years have passed since last update.

CSVを取り込むときに"を除去するサンプル

Posted at
Sapmle.vba
    Open varFileName For Input As #1
    Do Until EOF(1)
        Line Input #1, buf
        buf = Replace(buf, """", "")
        tmp = Split(buf, ",")

        ws.Cells(i, 1).Resize(1, UBound(tmp) + 1).Value = tmp
        i = i + 1
    Loop
    Close #1

CSV取込を行うときにデータがダブルクォート(")で囲まれていると扱いが面倒です
取り込むときにダブルクォートを除去するには、Replace関数で置き換えてやります

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3