| Junior Member with 2 posts. THREAD STARTER | | Join Date: Nov 2011 Experience: Beginner | |
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("A2 800")
.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! |