I can't get the Case structure right. Tried several different ways. It works with 07 and 09 but not 08.
lRowCount = InputBox("How many rows to process?")
ActiveCell.Offset(0, 0).Activate
If lRowCount > 0 Then
Do While lOff <= lRowCount
oScrn.PutString Left(ActiveCell.Offset(lOff, 0).Value, 3), 3, 5 'acctnbr
oScrn.PutString Right(ActiveCell.Offset(lOff, 0).Value, 4), 3, 9 'acctnbr
For iCol = 1 To 12
Select Case iCol
Case Is <= 4
oScrn.PutString "07/" & iCol, 4, 7
Case 0
oScrn.PutString "08/" & iCol - 4, 4, 7
Case Else
oScrn.PutString "09/" & iCol - 4, 4, 7
End Select
oScrn.MoveRelative 1, 1, 1
oScrn.SendKeys ("<PF8>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
oScrn.SendKeys ("<Enter>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
ActiveCell.Offset(lOff, iCol) = _
oScrn.Area(20, 74, 22, 78).Value
Next
ActiveCell.Offset(lOff, iCol) = _
oScrn.Area(3, 19, 3, 63).Value
lOff = lOff + 1
Loop
lRowCount = InputBox("How many rows to process?")
ActiveCell.Offset(0, 0).Activate
If lRowCount > 0 Then
Do While lOff <= lRowCount
oScrn.PutString Left(ActiveCell.Offset(lOff, 0).Value, 3), 3, 5 'acctnbr
oScrn.PutString Right(ActiveCell.Offset(lOff, 0).Value, 4), 3, 9 'acctnbr
For iCol = 1 To 12
Select Case iCol
Case Is <= 4
oScrn.PutString "07/" & iCol, 4, 7
Case 0
oScrn.PutString "08/" & iCol - 4, 4, 7
Case Else
oScrn.PutString "09/" & iCol - 4, 4, 7
End Select
oScrn.MoveRelative 1, 1, 1
oScrn.SendKeys ("<PF8>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
oScrn.SendKeys ("<Enter>")
Do While Sess0.Screen.OIA.Xstatus <> 0
DoEvents
Loop
ActiveCell.Offset(lOff, iCol) = _
oScrn.Area(20, 74, 22, 78).Value
Next
ActiveCell.Offset(lOff, iCol) = _
oScrn.Area(3, 19, 3, 63).Value
lOff = lOff + 1
Loop