![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
I have two frames on a userform, Frame 2 and Frame 3. When the userform starts up, Frame 3 is disabled, but still visible (E.G: It's light grey and impossible to select). I did this by using the following code: Dim ctrl As Control For Each ctrl In Frame3.Controls ctrl.Enabled = Not ctrl.Enabled Next Now what I want to do is when I click commandbutton1, for Frame 2 to become disabled, and frame 3 to become enabled. But what code do I need to put into the commandbutton's click event? Help me, I'm at my wit's end!! Even my pigtails are going curly!! Thanks Janie xxxx |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Quote:
you could use Private Sub CommandButton1_Click() Frame2.Enabled = False Frame3.Enabled = True End Sub
__________________
"Have a good time......all the time" Ian Mac |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
Yeah, that disables the controls, but it doesnt do the same thing as my code. My code actually makes the whole frame and everything in it go light grey, which is what I need it to do. I need it to look un-selectable as well you see. Our users will sit there all day and click it otherwise...
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
Thanks for trying though! I appreciate it
If you can tell me how to do what I need then I'd be most grateful... xx |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
Oooh, I am so close!!!
I'm sure the code in the command button's event must be something like: Dim ctrl As Control For Each ctrl In Frame3.Controls ctrl.Enabled = True for each ctrl In Frame2.Controls ctrl.Enabled = True Next But it won't work!! Do any of you guys know how I can set it right? |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Apr 2002
Posts: 76
|
I've done it!! Woo-hoo!!
For Each ctrl In Frame2.Controls ctrl.Enabled = Not ctrl.Enabled Next If you were gonna reply, then thanks Janie xxxxxx |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|