Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,560
Default Macro to hide rows with zero in specifc column range

Hello

I have a workbook with multiple sheets. I would like to put together a
macro that will hide the rows in a given range on all sheets. For example,
on Sheet 1 the range of cells I need to evaluate for zero are C9:63. If any
of the cells in the range are zero, I want to hide the corresponding row. So
if C11 is zero, row 11 is hidden. I would repeat the macro for the same
ranges on Sheet 2, 3, 4,...

Any help is appreciated.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Macro to hide rows with zero in specifc column range

Sub HideRows()
For Each sh In ThisWorkbook.Worksheets
For Each c In sh.Range("C9:C63")
If c.Value = 0 Then
c.EntireRow.Hidden = True
Else
c.EntireRow.Hidden = False
End If
Next c
Next sh
End Sub

--
Best Regards,

Luke M
"David" wrote in message
...
Hello

I have a workbook with multiple sheets. I would like to put together a
macro that will hide the rows in a given range on all sheets. For
example,
on Sheet 1 the range of cells I need to evaluate for zero are C9:63. If
any
of the cells in the range are zero, I want to hide the corresponding row.
So
if C11 is zero, row 11 is hidden. I would repeat the macro for the same
ranges on Sheet 2, 3, 4,...

Any help is appreciated.

Thanks



Reply
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
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
A macro to copy & paste many rows (a range) to the next column .. genehunter New Users to Excel 11 April 21st 09 07:36 AM
How can I get a count of specifc words in a range? Dr. Crowbar Excel Worksheet Functions 1 September 18th 07 06:43 AM
Macro to Hide rows based on value of column F Scott Marcus Excel Discussion (Misc queries) 10 October 27th 06 11:57 PM
???Refer to a specifc cell in a named range Jaylin Excel Worksheet Functions 1 February 10th 06 11:47 AM


All times are GMT +1. The time now is 04:43 PM.

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

About Us

"It's about Microsoft Excel"