for next with variables

  • Thread starter Thread starter Frank Dulk
  • Start date Start date
F

Frank Dulk

I have variables A1, A2, A3, A4, A5

I want to use them in the following way

For i = 1 to 5 "A" & i = Valor Next

In other words, to use all the variables with the next for
 
I have variables A1, A2, A3, A4, A5

I want to use them in the following way

For i = 1 to 5    "A" & i = Valor    Next

In other words, to use all the variables with the next for

if you declare A as an array, you can loop through the subscripts.

Dim A(1 to 5) as integer
for intCounter = 1 to 5
'do something with A(intCounter)
next intCounter
 
thank you


"Piet Linden" <[email protected]> escreveu na mensagem
I have variables A1, A2, A3, A4, A5

I want to use them in the following way

For i = 1 to 5 "A" & i = Valor Next

In other words, to use all the variables with the next for

if you declare A as an array, you can loop through the subscripts.

Dim A(1 to 5) as integer
for intCounter = 1 to 5
'do something with A(intCounter)
next intCounter
 
Back
Top