Dave,
I know the problem, but not the solution...
The leading spaces are causing me a problem in the text files. I also
took out the Lower Case option; although, I'm not sure if that was part
of my problem or not. As you can see below, I padded Str1 with the
leading spaces and it worked fine, but Str2 still returned **Error**.
'Str1 = LCase("Property Address:")
'Str2 = LCase("Total Value:")
Str1 = (" Property Address:")
Str2 = ("Total Value:")
Also note in my Do While Loop I also took out the LCase option.
Do While Not EOF(FileNum)
Line Input #FileNum, myLine
'If LCase(Left(myLine, Len(Str1))) = Str1 Then
If Left(myLine, Len(Str1)) = Str1 Then
wks.Cells(oRow, "A").Value = Trim(Mid(myLine, Len(Str1) +
1))
FoundAddr = True
'ElseIf LCase(Left(myLine, Len(Str2))) = Str2 Then
ElseIf (Left(myLine, Len(Str2))) = Str2 Then
wks.Cells(oRow, "B").Value = Trim(Mid(myLine, Len(Str2) +
1))
FoundTot = True
Exit Do 'no need to contine reading the file
End If
Loop
Is there a way to strip out or not consider the leading blank spaces.
Thanks again for your help. This application is going to cut my old
manual processing time down from about 5 days to less than 1 day.
Thanks
Willie T
|