Printing with conditions in excel

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Buildergirl

Thread Starter
Joined
Nov 23, 2011
Messages
2
Hi, I am having a hard time with creating a macro that will hide rows when a specific column value is equal to 0 or blank only upon printing. I have this macro currently... which works however I can not get it to un-hide rows.

Sub HideRows()
With Range("A2:D800")
.EntireRow.Hidden = False
For Each cell In Range("C7:C" & ActiveCell.SpecialCells(xlCellTypeLastCell).Row)
Select Case cell.Value
Case Is = 0
cell.EntireRow.Hidden = True
Case Is = ""
cell.EntireRow.Hidden = True
End Select
Next cell
End With
End Sub


Is there a better code out there to allow me to work in all rows in the workbook and only hide the rows with my specific criteria upon printing? i need the criteria to be based on column C staring in row 7 that any cell with 0 or blank will not print. It sounds so simple but I am hitting a wall and would appreciate any help!
 

Buildergirl

Thread Starter
Joined
Nov 23, 2011
Messages
2
Also I should note I need this to be generated automatically when printing so that other users only have to hit print and not filter...
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top