LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
MWS MWS is offline
external usenet poster
 
Posts: 53
Default Password Protecting/Unprotecting Via Code

I have a worksheet that has hidden rows and I'd like to write the code so
upon the user activating the worksheet, they are prompted for a password
and....

If the correct password is enterred, the rows become unhidden (that part is
not a problem).

And, if either an incorrect password OR the user selects "cancel" at the
password prompt, the process is aborted and the user is simply returned to
the worksheet and the rows remain unhidden (this section is my problem).
Currently, if the user inputs an incorrect password OR selects cancel, the
code fails.

The code I have is as follows:

Private Sub Worksheet_Activate()
ActiveSheet.Unprotect
Rows("2:5000").Select
Selection.EntireRow.Hidden = False
Range("F1").Select
End Sub

Can someone help by providing the additional code so the process executes as
desired?

Any and all help is appreciated - Thank You


 
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
protecting and unprotecting Fusion1337 Excel Worksheet Functions 5 September 26th 08 04:03 PM
Protecting & Unprotecting Sheets Pete[_4_] Excel Programming 5 May 10th 05 09:43 PM
PROTECTING/UNPROTECTING SHEETS Maureen Excel Discussion (Misc queries) 1 January 6th 05 06:46 PM
protecting vba code and unprotecting using a vba macro iain Excel Programming 0 June 29th 04 04:59 PM
Protecting/Unprotecting Workbook Sonny Maou Excel Programming 4 February 18th 04 04:59 PM


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

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

About Us

"It's about Microsoft Excel"