View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default hide / show rows based on two drop down selectiosn

Hi Maritza

Repeat this block for your second cell

If Not Application.Intersect(Range("D7"), Target) Is Nothing Then
Range("A29:A47").EntireRow.Hidden = False


If Target.Value = "Refund" Then
Range("a29:a32,A39:A40").EntireRow.Hidden = True

ElseIf Target.Value = "Write off" Then
Range("a33:a46").EntireRow.Hidden = True

Else
Range("A29:a32,a41:a46").EntireRow.Hidden = True
End If

End If


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Maritza" wrote in message ...
I really need help again. Now I have two drop downs and rows need to be
hidden or shown based on both selections.

The following works for one. Can I add a second target?

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("D7"), Target) Is Nothing Then
Range("A29:A47").EntireRow.Hidden = False


If Target.Value = "Refund" Then
Range("a29:a32,A39:A40").EntireRow.Hidden = True

ElseIf Target.Value = "Write off" Then
Range("a33:a46").EntireRow.Hidden = True

Else
Range("A29:a32,a41:a46").EntireRow.Hidden = True
End If

End If
End Sub


Thanks!
--
Maritza