This may be a dumb question but here it goes. Is there a way to store the result of each pass of a For Next loop. I want to see the value from each pass stored in a varuble that I can call later.
Make use of an array, Here is the sample code in its simple form, you can modify the same code to suit your need.
Code:
Public Function StoringLoopValue()
Dim StoreLoopValue(15) As Integer
For I = 1 To 16
StoreLoopValue(I - 1) = I
Next I
For I = 0 To 15
MsgBox StoreLoopValue(I)
Next I
End Function
Public Function StoringLoopValue()
Dim StoreLoopValue(15) As String
For I = 1 To 16
StoreLoopValue(I - 1) = me.sometext
Next I
For I = 0 To 15
MsgBox StoreLoopValue(I)
Next I
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.