|
▼es さん:
とりあえず現行の複数ファイル選択ベースです。
シートもファイル毎に、分けています。
Sub ファイル読み込み2()
Dim myfilenames As Variant
Dim i As Integer
Dim temp As String
Dim x As Long
Dim d As Variant
Dim dx As Variant
myfilenames = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(myfilenames) = True Then
If UBound(myfilenames) > ThisWorkbook.Worksheets.Count Then
MsgBox "選択されたファイル数が転記用シート数を超えています"
Else
For i = 1 To UBound(myfilenames)
temp = Space(FileLen(myfilenames(i)))
Open myfilenames(i) For Binary As #i
Get #i, , temp
Close #i
d = Split(temp, vbCrLf)
x = 0
For Each dx In d
x = x + 1
ThisWorkbook.Worksheets(i).Cells(x, "A").Value = dx
Next
Next i
End If
End If
End Sub
|
|