SpectreHUN
New Member
- Joined
- Aug 15, 2014
- Messages
- 14
I want to hide certain rows based on a selection from a drop-down list. My code so far:
My problem is that the macro runs, it hides said two rows, then when an other item is selected from the drop-down, it doesn't seem to run anymore. Any suggestions? Thanks in advance!
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Cells(10, 8).Value = "Yes" Then
'ActiveSheet.Unprotect
Rows("11:12").Hidden = False
'ActiveSheet.Protect , DrawingObjects:=True, Contents:=True, Scenarios:=True
Else
'ActiveSheet.Unprotect
Rows("11:12").Hidden = True
'ActiveSheet.Protect , DrawingObjects:=True, Contents:=True, Scenarios:=True
End If
End Sub
My problem is that the macro runs, it hides said two rows, then when an other item is selected from the drop-down, it doesn't seem to run anymore. Any suggestions? Thanks in advance!