For me it is not working !! Please help !!
Dim TransId As String
Dim Path As String
Dim FileName As String
Dim fso As New FileSystemObject
Dim i As Integer
i = 1
TransId = "A0000000000425997"
Path = "D:\SearchTransaction_FSO\"
FileName = Dir(Path & "*.txt")
With CreateObject("scripting.filesystemobject")
Do While FileName <> ""
If InStr(.OpenTextFile(Path & FileName).ReadAll, TransId) = 0 Then
Worksheets(1).Cells(i + 1, 1) = i
Worksheets(1).Cells(i + 1, 2) = TransId
Worksheets(1).Cells(i + 1, 3) = Replace(FileName, ".txt", "")
i = i + 1
End If
FileName = Dir
Loop
End With