Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide, Print, Unhide Rows


I am looking for a macro to hide rows with zero values (all cells in the
row must equal zero), it should skip blank rows, print, then unhide the
rows.

The attached file is a sample and the data range I am focusing on is =
D10:P154.

Thanks!


+-------------------------------------------------------------------+
|Filename: Book3.zip |
|Download: http://www.excelforum.com/attachment.php?postid=2802 |
+-------------------------------------------------------------------+

--
pfosz
------------------------------------------------------------------------
pfosz's Profile: http://www.excelforum.com/member.php...o&userid=16792
View this thread: http://www.excelforum.com/showthread...hreadid=319893

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hide, Print, Unhide Rows

Hi

Try this example for the activesheet

Sub Example()
Dim Lrow As Long
Dim CalcMode As Long
Dim StartRow As Long
Dim EndRow As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

With ActiveSheet
.DisplayPageBreaks = False
StartRow = 10
EndRow = 154
For Lrow = EndRow To StartRow Step -1
If Application.CountIf(Range(.Cells(Lrow, "D"), _
.Cells(Lrow, "P")), "0") = 13 Then .Rows(Lrow).Hidden = True
Next
.PrintOut
.Range("A1:A154").EntireRow.Hidden = False
End With

With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"pfosz" wrote in message ...

I am looking for a macro to hide rows with zero values (all cells in the
row must equal zero), it should skip blank rows, print, then unhide the
rows.

The attached file is a sample and the data range I am focusing on is =
D10:P154.

Thanks!


+-------------------------------------------------------------------+
|Filename: Book3.zip |
|Download: http://www.excelforum.com/attachment.php?postid=2802 |
+-------------------------------------------------------------------+

--
pfosz
------------------------------------------------------------------------
pfosz's Profile: http://www.excelforum.com/member.php...o&userid=16792
View this thread: http://www.excelforum.com/showthread...hreadid=319893



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
Enabling option „Format rows“ to hide/unhide rows using VBA-code? ran58 Excel Discussion (Misc queries) 0 July 28th 09 03:46 PM
How to Hide and Unhide Rows Jonno Excel Discussion (Misc queries) 2 June 9th 09 04:34 PM
hide or unhide rows with button Bea Excel Discussion (Misc queries) 15 September 19th 07 07:03 PM
Hide Unhide Rows blackstar Excel Discussion (Misc queries) 2 February 6th 06 09:36 PM
How to hide and unhide rows Michael168[_10_] Excel Programming 1 October 6th 03 11:52 AM


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