Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
protect sheet when cell is not blank
Hello
In VBA - Cell N11 is blank, but whenever Cell N11 is not blank I want to protect the entire sheet with the word "pass" thanks in advance |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
protect sheet when cell is not blank
This goes into the worksheet's code module (right-click on the sheet's name
tab and choose View Code from the list, then copy and paste this into the module presented to you). Naturally cell N11 is going to have to be unlocked or you won't be able to clear the entry in it once the sheet goes into protected state: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address < "$N$11" Then Exit Sub End If If IsEmpty(Target) Then ActiveSheet.Unprotect Password:="PASS" Else ActiveSheet.Protect Password:="PASS" End If End Sub "Wanna Learn" wrote: Hello In VBA - Cell N11 is blank, but whenever Cell N11 is not blank I want to protect the entire sheet with the word "pass" thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting data into next blank cell down in next sheet | Excel Worksheet Functions | |||
Using if function to show blank when cell in other sheet is empty | Excel Worksheet Functions | |||
Protect Workbook Vs Protect Sheet | New Users to Excel | |||
Password protect cell ranges NOT sheet | Excel Discussion (Misc queries) | |||
Protect Cell if value <> 0 OR blank? | Excel Worksheet Functions |