piers_morgan
New Member
- Joined
- Sep 3, 2003
- Messages
- 20
Hello. I'm afraid I have been searching a very long time but cannot find the solution.
I have a userform with several frames. The frame names are stored in a worksheet table. When the userform is open, if the user selects a dropdown the worksheet table updates a single cell. Inside this cell is the name of the frame that should be brought to a specific location in the userform.
Or to explain more simply, this bit of hard-coded code will work:
userform1.frame1.top = 210
This code will work fine too for frame2:
userform1.frame2.top = 210
For frame 3, etc...
userform1.frame3.top = 210
But what if sheet1 cell A1 changes to frame1, frame2, frame3, etc? What code will dynamically change the "hard" code? For example, something like:
userform1.sheet1("a1").value.top = 210
Thanks for the help!
Piers.
ps, this is to avoid potentially hundreds of "if this then" commands, so appreciate if this is not part of the answers )
I have a userform with several frames. The frame names are stored in a worksheet table. When the userform is open, if the user selects a dropdown the worksheet table updates a single cell. Inside this cell is the name of the frame that should be brought to a specific location in the userform.
Or to explain more simply, this bit of hard-coded code will work:
userform1.frame1.top = 210
This code will work fine too for frame2:
userform1.frame2.top = 210
For frame 3, etc...
userform1.frame3.top = 210
But what if sheet1 cell A1 changes to frame1, frame2, frame3, etc? What code will dynamically change the "hard" code? For example, something like:
userform1.sheet1("a1").value.top = 210
Thanks for the help!
Piers.
ps, this is to avoid potentially hundreds of "if this then" commands, so appreciate if this is not part of the answers )