| 
    
     |  | ゆうゆうさん、皆さん、こんにちは。 
 >txtの拡張子であるファイルはすべて取り込む
 ということにしてみました。
 
 Sub aaa02()
 Dim fName As String, fPath As String
 Dim fsoText As Object
 Dim i As Integer, j As Integer
 Dim lstLine As Long
 lstLine = 4 '取得する行数
 fPath = ThisWorkbook.Path & "\"
 fName = Dir(fPath & "*.txt")
 i = 1
 Do While fName <> ""
 Set fsoText = CreateObject("Scripting.FileSystemObject").OpenTextFile(fPath & fName, 1)
 Cells(i, 1).Value = fName '1列目にファイル名
 For j = 2 To lstLine + 1
 Cells(i, j).Value = fsoText.ReadLine
 Next
 fsoText.Close
 fName = Dir
 i = i + 1
 Loop
 Set fsoText = Nothing
 End Sub
 
 >ここ1週間、右肋骨下辺りがチクチクするので、胆石にビクついてます。
 Jakaさん、お大事に。(^・^)・・・でも、もう帰ったかな??
 
 
 |  |