| 
    
     |  | kawataです、お世話になっております、よろしくお願いします。 (Windows2000/Excel2000)
 
 テキストファイルを読み込んで加工するマクロを作成しています。
 読込時に、いくつかの条件をつけてシートに貼り付けていくのですが
 テキストが25000行ぐらいあり、かなり時間がかかります。
 
 下記のコードと同じ動作で速くするにはどうすればいいのでしょうか?。
 よろしくお願いします。
 
 Sub 読込()
 
 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
 
 With Sheets("data")
 e_row = e_row + 1
 .Range("a" & e_row).Value = TextLine
 End With
 
 End If
 Loop
 
 Close #1
 
 End Sub
 
 |  |