Hi,
I am updating a mainframe application with Attachmate via Excel. My data begins in Column A5 and continues down the column until the last row. If there is additional data, it continues every 5th column, Column E5,I5,M5 until Y5.
My coding basically copies each cell in Column A to the mainframe, does an update,and then continues down to the next cell and so forth.
The following code works but I stopped with Column E because there must be an easier method of writing this.
How can I re-write the coding so that it will loop every 5th column until there is no data in row 5 of that column?
thanks
zach
I am updating a mainframe application with Attachmate via Excel. My data begins in Column A5 and continues down the column until the last row. If there is additional data, it continues every 5th column, Column E5,I5,M5 until Y5.
My coding basically copies each cell in Column A to the mainframe, does an update,and then continues down to the next cell and so forth.
The following code works but I stopped with Column E because there must be an easier method of writing this.
How can I re-write the coding so that it will loop every 5th column until there is no data in row 5 of that column?
Code:
Sub Overflow5()
Dim Sessions As Object
Dim System As Object
Dim Sess0 As Object
Set System = CreateObject("EXTRA.System")
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession
Dim Rw As Long
Sheets("Sheet1").Select
For i = 5 To ActiveSheet.Rows.Count
If Range("A" & i).FormulaR1C1 = "" Then
For j = 5 To ActiveSheet.Rows.Count
If Range("E" & j).FormulaR1C1 = "" Then
For k = 5 To ActiveSheet.Rows.Count
If Range("I" & k).FormulaR1C1 = "" Then
Exit Sub
End If
Location = Range("I" & k)
Sess0.Screen.PutString Location, 2, 11
Sess0.Screen.SendKeys ("<PF5>") 'Update MainFrame
Next k
End If
Location = Range("E" & j)
Sess0.Screen.PutString Location, 2, 11
Sess0.Screen.SendKeys ("<PF5>") 'Update MainFrame
Next j
End If
Location = Range("A" & i)
Sess0.Screen.PutString Location, 2, 11
Sess0.Screen.SendKeys ("<PF5>") 'Update MainFrame
Next i
End Sub
thanks
zach