Select Option button unhide row

W

Wanna Learn

Hello in Row 33 I have two option buttons created using control tool
box. What I want to do is if the second option button is selected to unhide
rows 34 thru 36. thanks
 
W

Wanna Learn

Thanks Kevin I must be doing something wrong . it does not work. please
clarify thanks
 
K

Kevin B

Try this.

Press Alt + F11 to open the VBE, click INSERT on the menu and select MODULE.

In the new Module enter the following sub, changing the worksheet index
number to the sheet you want to unhide the rows in. You can also use the
name as as string Sheets("WorksheetName")

Sub Unhide()

Dim ws As Worksheet

Set ws = ThisWorkbook.Sheets(1)

ws.Rows("34:36").EntireRow.Hidden = False

Set ws = Nothing

End Sub

Click file in the menu and select CLOSE AND RETURN TO EXCEL.

In the worksheet where the button is located, open the CONTROL TOOLBOX
toolbar and click the DESIGN MODE button. Right click the command button and
select VIEW CODE and enter the name of sub UNHIDE, without parenthesis.

Click file in the menu and select CLOSE AND RETURN TO EXCEL.

Turn DESIGN MODE off, save your workbook and give it a test drive
 
W

Wanna Learn

Again Thanks - forgive my ignorance.. the name of the worksheet is Form.
exactly where do I enter the name of the sheet Thsnks again
 
D

Dave Peterson

Set ws = ThisWorkbook.Sheets("Form")

Wanna said:
Again Thanks - forgive my ignorance.. the name of the worksheet is Form.
exactly where do I enter the name of the sheet Thsnks again
 
Top