ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code for OptionButton displaying new frame (https://www.excelbanter.com/excel-programming/414119-code-optionbutton-displaying-new-frame.html)

[email protected]

Code for OptionButton displaying new frame
 
Hi all!

I have a user form with several frames containing optionbuttons. I
want frame 4 to only be displayed if certain OptionButtons in Frame 1
are selected. If they are not selected I want Frame 4 to remain
hidden.

Is there a way to do this?

Thanks in advance
Paul

Susan

Code for OptionButton displaying new frame
 
in your userform_initialization code, make frame4.visible=false

then on each of the option buttons that you want it to become visible,
use the click event:

private sub opt1_click()
frame4.visible=true
end sub

if you need to re-use the userform, make sure you call the
initialization code again to reset it & make frame4 invisible once
more.
hope this helps
susan



On Jul 16, 9:05*am, wrote:
Hi all!

I have a user form with several frames containing optionbuttons. I
want frame 4 to only be displayed if certain OptionButtons in Frame 1
are selected. If they are not selected I want Frame 4 to remain
hidden.

Is there a way to do this?

Thanks in advance
Paul



[email protected]

Code for OptionButton displaying new frame
 
PERFECT!! Thank you soooooo much!



All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com