Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Printing / February 2005

Tip: Looking for answers? Try searching our database.

Print only rows without zero values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
michelle - 13 Feb 2005 23:04 GMT
Hi all,

I have a friend who brought me a Lotus 123 spreadsheet which I converted
to Excel.  The problem is the 123 spreadsheet did not print some rows
that contained zeros, which was by design.  I could not find any macro
or setting that did this and I am not familiar with any Excel setting
that does this.

What is a simple way to suppress the printing of an entire row that
contains a zero value in a specific cell?

TIA,

Miki
Oliver Ferns - 14 Feb 2005 08:09 GMT
Hi,
You could apply an autofilter to hide the rows that contain the 0 cell.
They would not print then.

Hth,
Oli
Gord Dibben - 14 Feb 2005 17:29 GMT
Miki

Could you Autofilter out the rows with zeros and then print?

Gord Dibben Excel MVP

>Hi all,
>
[quoted text clipped - 10 lines]
>
>Miki
michelle - 14 Feb 2005 10:37 GMT
> Miki
>
[quoted text clipped - 16 lines]
>>
>>Miki

How could that be setup so that it was done without any user
intervention?...the Lotus spreadsheet was used by persons who did
nothing but enter data and print the results...

Miki
Gord Dibben - 14 Feb 2005 21:41 GMT
Miki

Sub Hide_Zeros()
ActiveSheet.Range("A:A").AutoFilter
   Selection.AutoFilter Field:=1, Criteria1:=">0", Operator:=xlAnd
   ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
   Selection.AutoFilter
End Sub

Filters out rows which have a zero in column A, prints that filtered list then
takes the filter off.

Assign the macro to a Button and instruct your users to hit that button to
print.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module.  Paste the code in there.  Save the
workbook and hit ALT + Q to return to your workbook.

The macro can be assigned to a button or shortcut-key combo.

Gord

>How could that be setup so that it was done without any user
>intervention?...the Lotus spreadsheet was used by persons who did
>nothing but enter data and print the results...

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.