I have a macro contains fixed name of a variable except that the last character changes: i.e.(BatchTotal1, BatchTotal2, BatchTotal3,...,etc.).
Each BatchTotal's value of the above is defined in another macro so I publicly defined them at first place.
The problem is that I tried to use them in a loop but in vain, BatchTotal(i) always return 0 please check 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