strathybananas
New Member
- Joined
- Mar 15, 2011
- Messages
- 9
Hey Guys,
I am currently creating a programme which uses a drop down box, and I want to get rid of different options depending on the box selected.
However, I am having trouble getting rid of the rows which contain 'HIDE', which I have labelled as needing to be hidden (row height = 0).
I have been using a borrowed VBA code which gets rid of the 'HIDE' rows, but won't return them for the relevent boxes! (if that makes sense?!)
The code is:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
' Dim R As Range
' Set R = Application.Intersect(Target, Range("A1:E50"))
' If R Is Nothing Then Exit Sub
With ActiveSheet
For Each cell In Range("A1:E50")
If cell.Value = "HIDE" Then
cell.EntireRow.Hidden = True
End If
Next
End With
Application.ScreenUpdating = True
End Sub
Essentially, what I'm asking is how can I alter this code to return my 'HIDE' boxes when they no longer =HIDE?
Thanks,
Johnnie
I am currently creating a programme which uses a drop down box, and I want to get rid of different options depending on the box selected.
However, I am having trouble getting rid of the rows which contain 'HIDE', which I have labelled as needing to be hidden (row height = 0).
I have been using a borrowed VBA code which gets rid of the 'HIDE' rows, but won't return them for the relevent boxes! (if that makes sense?!)
The code is:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False
' Dim R As Range
' Set R = Application.Intersect(Target, Range("A1:E50"))
' If R Is Nothing Then Exit Sub
With ActiveSheet
For Each cell In Range("A1:E50")
If cell.Value = "HIDE" Then
cell.EntireRow.Hidden = True
End If
Next
End With
Application.ScreenUpdating = True
End Sub
Essentially, what I'm asking is how can I alter this code to return my 'HIDE' boxes when they no longer =HIDE?
Thanks,
Johnnie