Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Protect Cells After Input - help with macro
I want to protect cells once the user has entered data. I have the following
macro which I think fails to work because some of the cells in the Target Range are merged Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim myRng As Range Dim myCell As Range Set myRng = Me.Range("A11:K33,") If Intersect(Target, myRng) Is Nothing Then Exit Sub End If Me.Unprotect Password:="al" For Each myCell In Target.Cells If myCell.Value = "" Then Else myCell.Locked = True End If Next myCell Me.Protect Password:="al" End Sub Thanks for any help or suggestions. Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
unable to protect cells in macro sheet b/c runtime error 1004 | Excel Worksheet Functions | |||
run macro with input msg based on cell input | Excel Discussion (Misc queries) | |||
Setting of input cells as blue font and formula cells as black fon | Excel Discussion (Misc queries) | |||
Protect macro | Excel Discussion (Misc queries) | |||
Macro to move to specified cells, pause for input at each? | Excel Discussion (Misc queries) |