View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default How to Specify Multiple Rows to Hide

Range("98:103,116:121,180:185").EntireRow.Hidden = True

Regards,
Peter T

"Paige" wrote in message
...
Can someone help me with how to designate multiple sets of rows to hide?

I
have the following code, but it errors out with 'Invalid use of property'

or
'Unable to set the hidden property'; there is no protection set. I've

used
the following variations and nothing works; I'm trying to get away from

using
separate lines to designate rows 98:103, rows 116:121, and rows 180:185,

and
instead group them together:

Thanks for any help!

Variation #1:
If Target.Address = "$C$16" Or Target.Address = "$C$14" Then
If Range("$C$16") = "x" Then
If Range("$C$14") = 12 Then
Rows("21:92").Hidden = False
Range("98:103,116:121,180:185").Hidden
End If
End If
End If

Variation #2:
If Target.Address = "$C$16" Or Target.Address = "$C$14" Then
If Range("$C$16") = "x" Then
If Range("$C$14") = 12 Then
Rows("21:92").Hidden = False
Range("98:103,116:121,180:185").Hidden = True
End If
End If
End If

Variation #3:
If Target.Address = "$C$16" Or Target.Address = "$C$14" Then
If Range("$C$16") = "x" Then
If Range("$C$14") = 12 Then
Range("21:92").Hidden
Range("98:103,116:121,180:185").Hidden
End If
End If
End If

Variation #4:
If Target.Address = "$C$16" Or Target.Address = "$C$14" Then
If Range("$C$16") = "x" Then
If Range("$C$14") = 12 Then
Range("21:92").Hidden = False
Range("98:103,116:121,180:185").Hidden = True
End If
End If
End If