| 
    
     |  | こんにちは。 こんな感じにするとか...。
 
 Dim haa() As variant
 read_file = "c:\test.txt"
 e_row = 0
 
 Open read_file For Input As #1
 Do While Not EOF(1)
 Line Input #1, TextLine
 If (Len(TextLine) > 0 And _
 Not TextLine Like "*AAA*" And _
 Not TextLine Like "*BBB*") Then
 i = i + 1
 ReDim Preserve haa(1 To i)
 haa(i) = TextLine
 If i = 5000 Then
 Sheets("data").Range("A65536").End(xlUp).Offset(1).Resize(UBound(haa)).Value = Application.Transpose(haa)
 Erase haa
 i = 0
 End If
 End If
 Loop
 Close #1
 If i <> 0 Then
 Sheets("data").Range("A65536").End(xlUp).Offset(1).Resize(UBound(haa)).Value = Application.Transpose(haa)
 End If
 Erase haa
 
 |  |