Hey all,
Looking for some help with arrays, and using them as a range in my for loop.
Currently here's what I have (that's relevant)
Dim planRows(14) As Integer
Dim z As Variant
<many lines that dictate whats in the array>
For c = a To b
For z = LBound(planRows) To UBound(planRows)
Sheets("Delta Tracking Log").Cells(c, 3) = Sheets(sheetName).Cells(z, 8)
Sheets("Delta Tracking Log").Cells(c, 4) = Sheets(sheetName).Cells(z, 12)
Sheets("Delta Tracking Log").Cells(c, 5) = Sheets(sheetName).Cells(z, 16)
Next z
Next c
--------------------------------------------------------------------
I'm getting a 400 error every time, and it all stems from the line For z = LBound(planRows) To UBound(planRows)
I know this because I tried a "For Each" in its place, just to test it out, and it over-wrote the 3 lines repeatedly with just the last value in the array.
Can anyone help? Can provide the full VBA if necessary.
Looking for some help with arrays, and using them as a range in my for loop.
Currently here's what I have (that's relevant)
Dim planRows(14) As Integer
Dim z As Variant
<many lines that dictate whats in the array>
For c = a To b
For z = LBound(planRows) To UBound(planRows)
Sheets("Delta Tracking Log").Cells(c, 3) = Sheets(sheetName).Cells(z, 8)
Sheets("Delta Tracking Log").Cells(c, 4) = Sheets(sheetName).Cells(z, 12)
Sheets("Delta Tracking Log").Cells(c, 5) = Sheets(sheetName).Cells(z, 16)
Next z
Next c
--------------------------------------------------------------------
I'm getting a 400 error every time, and it all stems from the line For z = LBound(planRows) To UBound(planRows)
I know this because I tried a "For Each" in its place, just to test it out, and it over-wrote the 3 lines repeatedly with just the last value in the array.
Can anyone help? Can provide the full VBA if necessary.