Hi All,
The (Incomplete) code below hides rows based on a value of GF3 and works great until I password protect the sheet. How can I get this to work when the sheet is PW protected? I assume the code would have to unlock/lock the sheet each time the macro is ran?
If Target.Count = 1 Then
If Range("GF3").Value < "3" Then
Rows("13:52").EntireRow.Hidden = True
ElseIf Range("GF3").Value = "6" Then
Rows("13:52").EntireRow.Hidden = False
End If
End If
End If
If Not Intersect(Target, Range("F1")) Is Nothing Then 'Distro#1x24
If Target.Count = 1 Then
If Range("GF3").Value < "4" Then
Rows("21:52").EntireRow.Hidden = True
End If
End If
End If
If Not Intersect(Target, Range("F1")) Is Nothing Then 'Distro#1x48
If Target.Count = 1 Then
If Range("GF3").Value < "5" Then
Rows("37:52").EntireRow.Hidden = True
End If End If
End If
If Not Intersect(Target, Range("F1")) Is Nothing Then 'Distro#1x60
If Target.Count = 1 Then
If Range("GF3").Value < "6" Then
Rows("45:52").EntireRow.Hidden = True
End If
End If
End If
Thank you!
Russ
The (Incomplete) code below hides rows based on a value of GF3 and works great until I password protect the sheet. How can I get this to work when the sheet is PW protected? I assume the code would have to unlock/lock the sheet each time the macro is ran?
If Target.Count = 1 Then
If Range("GF3").Value < "3" Then
Rows("13:52").EntireRow.Hidden = True
ElseIf Range("GF3").Value = "6" Then
Rows("13:52").EntireRow.Hidden = False
End If
End If
End If
If Not Intersect(Target, Range("F1")) Is Nothing Then 'Distro#1x24
If Target.Count = 1 Then
If Range("GF3").Value < "4" Then
Rows("21:52").EntireRow.Hidden = True
End If
End If
End If
If Not Intersect(Target, Range("F1")) Is Nothing Then 'Distro#1x48
If Target.Count = 1 Then
If Range("GF3").Value < "5" Then
Rows("37:52").EntireRow.Hidden = True
End If End If
End If
If Not Intersect(Target, Range("F1")) Is Nothing Then 'Distro#1x60
If Target.Count = 1 Then
If Range("GF3").Value < "6" Then
Rows("45:52").EntireRow.Hidden = True
End If
End If
End If
Thank you!
Russ