Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Search Search
Search for:
Tech Support Guy > > >

Printing with conditions in excel


(!)

Buildergirl's Avatar
Buildergirl Buildergirl is offline
Junior Member with 2 posts.
THREAD STARTER
 
Join Date: Nov 2011
Experience: Beginner
23-Nov-2011, 02:13 PM #1
Printing with conditions in excel
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("A2800")
.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's Avatar
Buildergirl Buildergirl is offline
Junior Member with 2 posts.
THREAD STARTER
 
Join Date: Nov 2011
Experience: Beginner
23-Nov-2011, 02:17 PM #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...
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
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.


Tags
excel, macro, macro help, printing criteria

(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2