Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to print worksheet and automatically hide zero value rows?

Does anyone know how to create a worksheet that will automatically hide rows
that have zero values when you want to print?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to print worksheet and automatically hide zero value rows?

In one column or zeros in random cells in many rows and columns?

The entire row has to have zeros?

Several options depending upon what you mean.

If just one column, you could use DataFilterAutofilter to hide the rows with
zero in that column.


Gord Dibben MS Excel MVP

On Fri, 25 Jan 2008 15:47:01 -0800, Eric wrote:

Does anyone know how to create a worksheet that will automatically hide rows
that have zero values when you want to print?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to print worksheet and automatically hide zero value rows?

Thanks...the filtering works but I'm trying to create a form so the end users
does not have to use the filter function. I would like to have the filter
applied automatically when the end user prints the worksheet.
Any help/ideas would be appreciated.

"Gord Dibben" wrote:

In one column or zeros in random cells in many rows and columns?

The entire row has to have zeros?

Several options depending upon what you mean.

If just one column, you could use DataFilterAutofilter to hide the rows with
zero in that column.


Gord Dibben MS Excel MVP

On Fri, 25 Jan 2008 15:47:01 -0800, Eric wrote:

Does anyone know how to create a worksheet that will automatically hide rows
that have zero values when you want to print?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to print worksheet and automatically hide zero value rows?

Right-click on the Excel Icon left of "File" on menu bar.

Select "View Code"

Copy/paste this code into the module. Adjust the column(D) to suit.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim RngCol As Range
Dim i As Range
Set RngCol = Range("D1", Range("D" & Rows.Count). _
End(xlUp).Address)
For Each i In RngCol
If i.Value = 0 Then
i.EntireRow.Hidden = True
End If
Next i
End Sub


Gord

On Fri, 25 Jan 2008 16:36:01 -0800, Eric wrote:

Thanks...the filtering works but I'm trying to create a form so the end users
does not have to use the filter function. I would like to have the filter
applied automatically when the end user prints the worksheet.
Any help/ideas would be appreciated.

"Gord Dibben" wrote:

In one column or zeros in random cells in many rows and columns?

The entire row has to have zeros?

Several options depending upon what you mean.

If just one column, you could use DataFilterAutofilter to hide the rows with
zero in that column.


Gord Dibben MS Excel MVP

On Fri, 25 Jan 2008 15:47:01 -0800, Eric wrote:

Does anyone know how to create a worksheet that will automatically hide rows
that have zero values when you want to print?




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
automatically hide rows with zero value hfc21 Excel Worksheet Functions 1 January 23rd 06 07:33 PM
Hide rows automatically kim Excel Discussion (Misc queries) 1 September 14th 05 02:23 PM
program excel worksheet to automatically not print blank rows [email protected] Excel Discussion (Misc queries) 2 July 26th 05 02:11 PM
program excel worksheet to automatically not print blank rows [email protected] Excel Worksheet Functions 2 July 26th 05 02:11 PM
How do I automatically hide rows RobRoy Excel Discussion (Misc queries) 8 February 2nd 05 01:12 PM


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