![]() |
Making a frame visible or not using a command button
[Excel 2003]
I have a userform with a frame on it The form displays some text boxes. I would like the default setting of the frame to be not visible to the user, so I can set the property as such. What I would like is to have a command button on the form which makes the frame visible : frame.visible=True?? and a command button within the frame to hide the frame frame.visible=False?? Can anyone help? Thankyou, Roger |
Making a frame visible or not using a command button
Hi Roger
Copy the below code behind the userform. CommandButton1 is within the Frame and CommandButton2 is outside the frame Private Sub CommandButton1_Click() Me.Frame1.Visible = False End Sub Private Sub CommandButton2_Click() Me.Frame1.Visible = True End Sub Private Sub UserForm_Initialize() Me.Frame1.Visible = False End Sub -- Jacob "Roger on Excel" wrote: [Excel 2003] I have a userform with a frame on it The form displays some text boxes. I would like the default setting of the frame to be not visible to the user, so I can set the property as such. What I would like is to have a command button on the form which makes the frame visible : frame.visible=True?? and a command button within the frame to hide the frame frame.visible=False?? Can anyone help? Thankyou, Roger |
Making a frame visible or not using a command button
use one command button - this will toggle the frame visibility between on
and off Private Sub CommandButton1_Click() Frame1.Visible = NOT Frame1.Visible End Sub "Roger on Excel" wrote in message ... [Excel 2003] I have a userform with a frame on it The form displays some text boxes. I would like the default setting of the frame to be not visible to the user, so I can set the property as such. What I would like is to have a command button on the form which makes the frame visible : frame.visible=True?? and a command button within the frame to hide the frame frame.visible=False?? Can anyone help? Thankyou, Roger |
Making a frame visible or not using a command button
Thankyou Jacob And Patrick - both approaches are equally viable - Have a
great week, Roger "Roger on Excel" wrote: [Excel 2003] I have a userform with a frame on it The form displays some text boxes. I would like the default setting of the frame to be not visible to the user, so I can set the property as such. What I would like is to have a command button on the form which makes the frame visible : frame.visible=True?? and a command button within the frame to hide the frame frame.visible=False?? Can anyone help? Thankyou, Roger |
All times are GMT +1. The time now is 05:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com