Variable within the code

  • Thread starter Thread starter ngedwin
  • Start date Start date
N

ngedwin

Hi, i got many variables in the code e.g. Class1, Class2, Class3 .....

I want to use "For Next" loop to do something to every Class

but if i use

-----------------------------------------------
dim class1 as variant
dim class2 as variant
....

dim i as integer

for i=1 to 5

Class & i=.......(code goes here).......

next
 
Use an array

Dim myClass As Variant

Redim myClass(1 To 5)
For i = 1 To 5
myClass(i) = '....
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top