こんな感じ? もっと単純な方法があるのかもしれませんが・・・。
Sub test()
Dim openFile As Variant
Dim i As Long, j As Integer, FFile As Integer
Dim myStr As String
Dim myArray
Const myNum = 200 '1行の文字数
'
openFile = Application.GetOpenFilename
If openFile = False Then Exit Sub
FFile = FreeFile
Open openFile For Input As #FFile
ReDim myArray(Rows.Count, 1)
i = 1
Do While Not EOF(FFile)
myStr = ""
For j = 1 To myNum
If EOF(FFile) Then Exit For
myStr = myStr + Input(1, #FFile)
Next j
myArray(i - 1, 0) = myStr
i = i + 1
If i > Rows.Count Then Exit Do
Loop
Range(Cells(1, 1), Cells(i - 1, 1)).Value = myArray
Close #FFile
Erase myArray
End Sub
|