Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am an occasional programmer and I would like some help on a problem:
I have 20 existing object labels on an Excel 2000 worksheet. They were initially added with no attention to their caption property. I need these labels to contain calculated data that periodically changes. My existing code to update these labels has 20 lines like this: txtX1.Caption = <some calculation txtX2.Caption = <some calculation .. .. .. txtX20.Caption = <some calculation I want to use something more elegant like a for-next loop, but I can't seem to figure how to dynamically change the label object reference from txtX1 to txtX2 to txtX3 (and so on) on each iteration of the for-next loop. If I assemble a reference as a string variable and append the .Caption, it generates a runtime error. What is the proper method for handling a task like this? I have often had to handle problems like this using the above method, but I'm sure there must be a better solution. Regards, Derrick. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Seperate data series on a similar X-axis | Charts and Charting in Excel | |||
Toggle Chart Series Objects On/Off | Charts and Charting in Excel | |||
Excel formula similar to a loop in Basic? | Excel Worksheet Functions | |||
Loop through objects/controls on worksheet | Excel Programming | |||
loop through form objects | Excel Programming |