Hi James,
You're surrounding each of your constants with " marks. Therefore VBA is creating an array of strings; this is what it looks like when you loop through each element in the array:-
Results:-Sub Test() Dim arrayRenewalControlNames Dim i As Long arrayRenewalControlNames = Array("DAY180", "DAY120", "DAY90", "DAY60", "DAY30", "EXPIRE_DAY") For i = LBound(arrayRenewalControlNames) To UBound(arrayRenewalControlNames) Debug.Print arrayRenewalControlNames(i) Next End Sub
DAY180
DAY120
DAY90
DAY60
DAY30
EXPIRE_DAY
If you remove the speech marks then the array will be created with the numeric values that you need e.g.
Results:-arrayRenewalControlNames = Array(DAY180, DAY120, DAY90, DAY60, DAY30, EXPIRE_DAY)
180
120
90
60
30
1
HTH
Dan





Reply With Quote