LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default How to Specify Multiple Rows to Hide

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I hide multiple rows under one row IN EXCEL? STEVEN Excel Worksheet Functions 3 May 7th 10 04:15 AM
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
Hide Rows - copy and paste only rows that show Access101 Excel Worksheet Functions 3 March 1st 06 12:39 AM
Macro to hide multiple rows Minh Excel Programming 2 August 31st 04 08:35 AM


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"