I have a macro that has a variable with a fixed name, but the final character is changed: i.e. (BatchTotal1, BatchTotal2, BatchTotal3,...,etc.).
The above BatchTotal values are each defined in a different macro, so I made them publicly defined first.
My attempt to use them in a loop was unsuccessful because BatchTotal(i) always returns 0. Please review my code:
Public BatchTotal(1 To 5) As Double
Sub priority_calculation()
'Some Code
For i = 1 To 5
If BatchTotal(i) > 0 Then
Cells(k, 2).PasteSpecial Paste:=xlPasteValues
Cells(k, 3) = C1
Cells(k, 8) = Q1
End If
Next i
End Sub