Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, My goal is to have code to, upon activating a sheet, to unprotect the
sheet if the user imputs the correct password and then complete some other tasks (the "other" portion I have figured out. The code is as follows: Private Sub Worksheet_Activate() If ActiveSheet.Protect = False Then ActiveSheet.Unprotect Rows("2:5000").Select Selection.EntireRow.Hidden = False Range("A1:L5004").Select Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Rows("2:2").Select ActiveWindow.FreezePanes = True Range("A1").Select End If The issue is, if the user does not value the correct password, they receive an error. My question is: What is the code to be added so if the user inputs the correct password the code continues and if the incorrect password is valued the execution aborts and the error meesage is not presented (I realize the user just needs to click "end" when then error is received, but I'd like to have a cleaner process). Any and All Help Is Appreciated - Thank You |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code Execution Message | Excel Discussion (Misc queries) | |||
How to ged rid of the "Execution Error 9" message at the file opening? | Excel Discussion (Misc queries) | |||
message without stopping execution? | Excel Programming | |||
Code Execution has been interrupted message | Excel Programming | |||
Message Box Execution | Excel Programming |