-
I am using Microsoft Excel 97 VBA to create an application containing 5 frames, each frame containing 49 labels. Each frame has it's own collection. I would like to be able to
sequence through each Userform!Frame(i).Controls() in order to consolidate my code..
Currently my code is similiar to
For Each Control In Userform!Frame1.Controls()
'Get Frame1 data
Next Control
For Each Control In Userform!Frame2.Controls()
'Get Frame2 data
Next Control
For Each Control In Userform!Frame3.Controls()
'Get Frame3 data
Next Control
...
The Get Frame1, Get Frame2, ... portions of the code are identical.
What I would like to do is:
for i = 1 to 5
For Each Control In Userform!Frame(i).Controls()
'Get Frame data
Next Control
next i
However, the above code does not work.
Help!
Vin
-
Well if the frames would been a control array it works.