Quick question - I have a two part macro,the first part that reads the data is working. It crashes on this part- and I get Subscript out of range. i did a debug the reason, there is not data that match my criteria in the first part (Empty). How can I perform incorporate a test to exit routine -
Sub print_ou2117(info() As CanUseForAll)
Dim i As Integer
Dim q As Long
Windows("FO.xls"
.Activate
Sheets("Sheet3"
.Select
Application.Calculation = xlCalculationManual
q = LastUsedRow(Range("A:E"
)
For i = 1 To UBound(info)
Cells(i + q, 1).Value = info(i).edate
Cells(i + q, 2).Value = info(i).trade_id
Cells(i + q, 3).Value = info(i).cflow
Cells(i + q, 4).Value = info(i).source
Cells(i + q, 5).Value = info(i).ou
Next i
Application.Calculation = xlCalculationAutomatic
Application.Calculate
End Sub
Sub print_ou2117(info() As CanUseForAll)
Dim i As Integer
Dim q As Long
Windows("FO.xls"
Sheets("Sheet3"
Application.Calculation = xlCalculationManual
q = LastUsedRow(Range("A:E"
For i = 1 To UBound(info)
Cells(i + q, 1).Value = info(i).edate
Cells(i + q, 2).Value = info(i).trade_id
Cells(i + q, 3).Value = info(i).cflow
Cells(i + q, 4).Value = info(i).source
Cells(i + q, 5).Value = info(i).ou
Next i
Application.Calculation = xlCalculationAutomatic
Application.Calculate
End Sub