Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default option button to hide rows, with password

Dear Experts,

I would like to provide an option button to enable users to hide preselected
rows (25 to 128) in a worksheet. Click on the button, the rows are hidden,
unclick the button the rows reappear. I have tried the following code in the
Sheet 5 (Code) window of the VB screen:

Private Sub OptionButton1_Click()
If OptionButton1.Value = True Then
Row("25:128").Select
Selection.EntireRow.Hidden = True
Else
Row("25:128").Select
Selection.EntireRow.Hidden = False
End If
End Sub

This code works to hide the rows, but the rows do not reappear (possibly
because the option button doesn't respond to the second click to clear the
button). I would appreciate any help please.

As an unexpected bonus, it would be excellent if the main user could be
asked for a user-specified password after clicking the option button to hide
the rows so the hidden rows are protected from viewing by others who access
the file. Then, when the main user wants to view the hidden rows, clicking
on the option button to clear the button would prompt the main user for his
password, after which the rows would unhide. If code can't do this, then I
will direct the user to click on Tools, Protection, Protect Sheet to password
protect the sheet after hiding the rows.

Thank you for your expertise and assistance.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
option button (yes No) to hide rows Wanna Learn Excel Discussion (Misc queries) 3 April 2nd 09 06:29 PM
hide or unhide rows with button Bea Excel Discussion (Misc queries) 15 September 19th 07 07:03 PM
Code for button to hide/unhide rows Chris Excel Worksheet Functions 5 March 5th 07 06:15 AM
Command Button to Hide/Unhide Rows Bea Excel Discussion (Misc queries) 4 March 16th 06 03:21 PM


All times are GMT +1. The time now is 04:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"