Error when protecting sheet with cell has seperate password.
Maybe something like:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Set Rng = Range("D255") '<<==== CHANGE
If target.cells.count 1 then exit sub 'only one cell at a time
If Not Intersect(Rng, Target) Is Nothing Then
if lcase(target.value) = "y" then
Call HideAllWageData
end if
End If
End Sub
David wrote:
Getting runtime error 91 Object variable or With block variable not set when
running a protect macro.
I have cell D255 selected to allow users to edit with it's own password.
But when I run the protect all sheets macro, I get the above error.
Here is the code on the sheet I'm using:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rng As Range
Set Rng = Range("D255") '<<==== CHANGE
'If Not Intersect(Rng, Target) Is Nothing Then
If Intersect(Rng, Target) = "Y" Then '<<Error occurs here
Call HideAllWageData
End If
End Sub
I've looked, but see nothing on setting a seperate password to allow users
to edit certain cells/ranges.
David
--
Dave Peterson
|