1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Printing with conditions in excel

Discussion in 'Business Applications' started by Buildergirl, Nov 23, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. Buildergirl

    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!
     
  2. Buildergirl

    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...
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1028194