Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to test for "R" in any cell that was changed, if so it remains
unlocked all others should be locked. I have tried all sorts of items and always get a Error 13 type mismatch. What am I doing worng? Please Help Private Sub Worksheet_Change(ByVal Target As Excel.Range) Const sPWORD As String = "36" Dim rArea As Range Dim rCell As Range Me.Unprotect Password:=sPWORD For Each rArea In Target For Each rCell In rArea With rCell If Target.Value = Not "R" Then .Locked = Not IsEmpty(.Value) Else End If End With Next rCell Next rArea Me.Protect Password:=sPWORD End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
looping macro to test for borders | Excel Programming | |||
Test if macro is called by another macro | Excel Programming | |||
exit macro after test of cell value | Excel Programming | |||
How to test cell contents in a macro? | Excel Programming | |||
How can I test if a Macro if firing? | Excel Worksheet Functions |