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: 54
Default Multiple Ranges in Hide Row Code

Hi All,
I have code that works to hide rows with < 0 value for a specific range. I
have 20+ ranges I need to specify (obviosly none are sequential or it would
be a much larger range). It works with 2 ranges specified, but not with any
more. Below is the working and non working code. Is the solution some sort
of Set Range at the beginning of the sub? I tried it but couldn't get it to
work.

''' Working Code
Sub hide_row2()
For Each cell In Range("B21:B26", "B30:B51")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub

''' Non Working Code
Sub hide_row()
For Each cell In Range("B21:26", "B30:B51", "B57:B90", "B95:B112")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub

TIA,
Anders
 
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
show/hide multiple series using named ranges goofy11 Charts and Charting in Excel 1 December 8th 07 07:39 PM
Problem with Multiple Ranges in code Paul S Excel Discussion (Misc queries) 1 April 12th 07 07:01 PM
How to hide and secure ranges in worksheet John Excel Worksheet Functions 3 March 28th 07 08:59 AM
Crteating Multiple GIFS from Multiple Ranges -- need someone to test my code to see why it fails Father Guido[_5_] Excel Programming 4 November 22nd 05 05:28 AM
Crteating Multiple GIFS from Multiple Ranges -- need someone to test my code to see why it fails Father Guido[_5_] Excel Programming 0 November 19th 05 08:00 AM


All times are GMT +1. The time now is 08:54 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"