Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
right now I have code similar to below:
Variable1 = Form1.TextboxWidth1 * Form1.TextboxLength1 Variable2 = Form1.TextboxWidth2 * Form1.TextboxLength2 Variable3 = Form1.TextboxWidth3 * Form1.TextboxLength3 Variable4 = Form1.TextboxWidth4 * Form1.TextboxLength4 Variable5 = Form1.TextboxWidth5 * Form1.TextboxLength5 .... It's more complicated than that, but you get the idea. So anyway, I'd like to make a loop to accomplish the same task. Something along the lines of: For LoopCounter = 1 to 4 NewVariableName = "Variable" & LoopCounter NewTextWidthName = "Form1.TextBoxWidth" & LoopCounter NewTextLengthName = "Form1.TextBoxLength" & LoopCounter NewVariableName = NewTextWidthName * NewTextLengthName Next LoopCounter I'm pretty sure I've figured out how to do this in the past but I can't find anything about it now. How can I accomplish this? Is there a better way I'm missing? Thank you for any assistance you can give. Charles Hamlyn |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Incremental sheet names in a workbook | Excel Worksheet Functions | |||
Incremental Numbering: Compile Error - Variable not defined | Excel Programming | |||
Referencing Object Names with Variable | Excel Programming | |||
Run-time error '91': "Object variable or With block variable not set | Excel Programming | |||
Looping to create Variable Names? | Excel Programming |