R
ran58
Hello,
I have used the code below, which is tied to a multi-drop-down-list in
order to unhide/hide rows (unhiding rows = yes = 1, hiding rows = no =
2.
The macro works fine, unless the worksheet is being protected. I then
get a runtime-error 1004, saying the hidden property of the range
object cannot be determined (Code-Line 8). Is there any work-around
about this available? Many many thanks!
Sub HideRows()
Dim Rng As Range
Set Rng = Sheets("Ziel1").Range("K6")
If Rng.Value = 1 Then
Rows("7:19").EntireRow.Hidden = False
Range("K6").Select
ElseIf Rng.Value = 2 Then
Rows("7:19").EntireRow.Hidden = True
End If
End Sub
I have used the code below, which is tied to a multi-drop-down-list in
order to unhide/hide rows (unhiding rows = yes = 1, hiding rows = no =
2.
The macro works fine, unless the worksheet is being protected. I then
get a runtime-error 1004, saying the hidden property of the range
object cannot be determined (Code-Line 8). Is there any work-around
about this available? Many many thanks!
Sub HideRows()
Dim Rng As Range
Set Rng = Sheets("Ziel1").Range("K6")
If Rng.Value = 1 Then
Rows("7:19").EntireRow.Hidden = False
Range("K6").Select
ElseIf Rng.Value = 2 Then
Rows("7:19").EntireRow.Hidden = True
End If
End Sub