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,
 

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
Hi gdspeare,
Are these frames on a userform then?
Can we see the relevant part of the code currently being used?
 

gdspeare

Board Regular
Joined
Oct 8, 2002
Messages
198
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
 

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,453
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?
 

gdspeare

Board Regular
Joined
Oct 8, 2002
Messages
198
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?
 

Watch MrExcel Video

Forum statistics

Threads
1,111,493
Messages
5,541,041
Members
410,543
Latest member
ExcelGlenn
Top