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: 10
Default How to hide rows in a Workbook with multiple sheets with zero valu

Hi,

I am trying to create a code to run on a workbook with several work sheets
to hide rows with zero values.

I have used the following code:


Sub HideRowsIfColumnDisEmpty()
Dim X As Long
Dim LastRowOfData As Long
With Worksheets("Functional SummaryTotal Risk")
LastRowOfData = .Cells(.Rows.Count, "N").End(xlUp).Row
For X = 1 To LastRowOfData
If .Cells(X, "N").Value = 0 Then
.Cells(X, "N").EntireRow.Hidden = True
End If
Next
End With
End Sub

This works for one worksheet in a workbook, however I need this to work on
multiple sheets.

Could someone please help me on how I can modify this could so that it can
run successfully on multipule worksheets in a workbook.

Thank you.

Khurram
 
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
Hide all Sheets in Workbook then Close Workbook RyanH Excel Programming 0 January 29th 08 12:59 PM
hide non active sheets in workbook anon Excel Programming 2 October 3rd 07 07:16 PM
How do you insert rows into multiple sheets in a workbook? Marketing Queen Excel Discussion (Misc queries) 2 May 30th 06 05:33 PM
Hide columns in multiple sheets GregR Excel Programming 4 February 6th 06 09:09 PM
Hide Rows Across Mulitple Sheets Jason Penny Excel Programming 2 September 22nd 03 06:30 PM


All times are GMT +1. The time now is 04:26 AM.

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"