View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Maritza Maritza is offline
external usenet poster
 
Posts: 10
Default Hide row(s) based on drop down selection

I copied and pasted your info, made changes to suit my ranges. But when I
select things from the drop down - nothing happens.

Where did I go wrong?
--
Maritza


"Ron de Bruin" wrote:

You can use the change event in the sheet module

Try this one

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("D5"), Target) Is Nothing Then
Range("A25,A33:A36").EntireRow.Hidden = False
If Target.Value = "refund" Then
Range("A33:A36").EntireRow.Hidden = True
Else
Range("A25").EntireRow.Hidden = True
End If
End If
End Sub


--

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


"Maritza" wrote in message ...
I need to hide rows based on a drop down selection. Example: if d5 (drop down
cell) = refund, then hide rows 33 through 36, else hide row 25.

For the life of me my macro didn't work.

Thanks
--
Maritza