Hmmm - this does not work.
I will try to explain a bit better what i want to do here:
A2 = D12345
When I type in dCheck = s.autECLPS.GetText(1, 8, 3) , it loads the Terminal, then goes to Row 1, Cell 8, and grabs the first 3 letters after that. The text that it grabs is "D12"
I then want to go back into Excel and ask "Is the value of dCheck equal to the first 3 letters in cell A2?"
Excel should then look and say "Yes, D12 = D12"
When I used your code, (and added msg boxes to see what was was being captured), I found that:
dCheck = s.autECLPS.GetText(1, 8, 3)
dCheck = Application.Trim(debitCheck)
MsgBox Cells(tRow, 1).Offset(ttRow, 0).Value & " at " & Cells(tRow, 1).Offset(ttRow, 0).Address
MsgBox Left(Application.Trim(Cells(tRow, 1).Offset(ttRow, 0).Value), Len(dCheck))
If dCheck = Left(Application.Trim(Cells(tRow, 1).Offset(ttRow, 0).Value), Len(dCheck)) Then
MsgBox Left(Application.Trim(Cells(tRow, 1).Offset(ttRow, 0).Value), Len(dCheck))
End If
MsgBox Left(Application.Trim(Cells(tRow, 1).Offset(ttRow, 0).Value), Len(dCheck))
Is just giving me null value, instead of the first 3 characters from the left.
I'd try to help fix the code, but I'm not familiar with the Application.Trim command at all
Bookmarks