Dim dMaxDTE As Date, rw As Integer
Do
For i = 8 To 17
If Trim(Sess0.Screen.GetString(i, 54, 8)) = "" Then Exit For
If dMaxDTE < DateValue(Trim(Sess0.Screen.GetString(i, 54, 8))) Then
dMaxDTE = DateValue(Sess0.Screen.GetString(i, 54, 8))
rw = i
End If
Next i
'entering "E" at location (x,02).
[COLOR=#EF2929]Sess0.Screen.PutString(rw, 2) = "E"[/color]
'Sess0.Screen.SendKeys ("<Enter>")
If Sess0.Screen.GetString(23, 2, 4) = ("4941") Then Exit Do
'Sends the next page command
Sess0.Screen.SendKeys ("<Pf8>")
Do Until (Sess0.Screen.WaitForCursor(r, c)) 'r,c is screen cursor rest coordinates
DoEvents
Loop
Loop