Charles Bushby
New Member
- Joined
- Aug 10, 2005
- Messages
- 42
This piece of code is not working properly as the first value loads into the array but no other values load.
I can see that "i" increments to 2 but as soon as it hits the line with "For i = 1 To UBound(aCoupeColAd)" it reverts back to 1 again.
Here is the code if anyone can help work this out for me:
Do
If Not IsEmpty(wShCS.Cells(iRow, iCol + 10)) Then
iCoupeCounter = iCoupeCounter + 1
ReDim Preserve aCoupeColAd(1 To iCoupeCounter)
For i = 1 To UBound(aCoupeColAd) 'FOR SOME REASON ON THE SECOND ITERATION i REVERTS TO 1 AGAIN
aCoupeColAd(i) = iCol + 10
Next i
End If
iCol = iCol + 1
Loop Until iCol = 19
Many thanks in anticipation for any help received.
Charles
I can see that "i" increments to 2 but as soon as it hits the line with "For i = 1 To UBound(aCoupeColAd)" it reverts back to 1 again.
Here is the code if anyone can help work this out for me:
Do
If Not IsEmpty(wShCS.Cells(iRow, iCol + 10)) Then
iCoupeCounter = iCoupeCounter + 1
ReDim Preserve aCoupeColAd(1 To iCoupeCounter)
For i = 1 To UBound(aCoupeColAd) 'FOR SOME REASON ON THE SECOND ITERATION i REVERTS TO 1 AGAIN
aCoupeColAd(i) = iCol + 10
Next i
End If
iCol = iCol + 1
Loop Until iCol = 19
Many thanks in anticipation for any help received.
Charles