combined command button

gdspeare

Board Regular
Joined
Oct 8, 2002
Messages
198
Hello,

I have a page that has 12 frames on it. Each frame has a combobox, a few textboxes and two optoin buttons (none of that matters, just trying to set the stage).

when the form is loaded, each frame is set to a height of 30 and a width of 168. On the combobox_change event the frame height changes to 120 and the width to 240. I have added a command button on each frame to do two things:
1. reset the frame to the orignal size of 30x168
2. change the .visible properties back to true for any of the frames i had to hide for estethic reasons during the origal dimension change.

How can i write a module to call on the commandbutton_click that will:

1. change the .visible for any hidden frames
2. reset the current frame to 30x168

Thanks for the help,
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi gdspeare,
Are these frames on a userform then?
Can we see the relevant part of the code currently being used?
 
Upvote 0
The frames are on a multipage...

Private Sub combSLM1_Change()
frameSLM1.Height = 120
frameSLM1.Width = 240
frameSLM2.Visible = False
frameSLM3.Visible = False
frameSLM4.Visible = False

End Sub


Private Sub cmdDoneSL1_Click()
frameSLM1.Height = 30
frameSLM1.Width = 168
frameSLM2.Visible = True
frameSLM3.Visible = True
frameSLM4.Visible = True
 
Upvote 0
I guess I don't understand.
Your existing code for cmdDoneSL1 should be doing what I understand you're asking for.

Can you elaborate a bit?
 
Upvote 0
Yes, it is doing what I want, but I have 12 frames on my form and each frame has a command button that is essentially going to say the same thing. I want to be able to write one sub that says

"Close this frame and return the size to 30x168 also make visible any frames that are hidden"

Is that more clear?
 
Upvote 0

Forum statistics

Threads
1,213,538
Messages
6,114,217
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top