Hiding Rows within a range.

B

Bob

Hi all,
Back again with another Q. Is it possible to create a macro or
something so that when you print, it will autmoatically hide rows within a
certain rage when a column's value = 0.

Example.
A price list with 5 rows (rows 13 - 17). Column A is the "Quantity" value.
We're only ordering two things from this list (on row 14 & 16). So I want
to hide all the other rows within the 13 - 17 range where Column A quantity
vaule is equl to 0 so that it only prints what we're buying.

Thanks again for the help.
Bob
 
D

Don Guillett

something like this should work
Sub printsales()
With Range("c1:c21")
..SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True
..PrintPreview
..EntireRow.Hidden = False
End With
End Sub
 
B

Bob

Thanks for the response!
Will this select rows where the value equals the number 0 or rows that are
blank?
 
D

Don Guillett

blank. If you want 0's you would want to autofilter on <>0 and then print.
Record a macro
 
B

Bob

Does this work where the cell contains a value of 0 or just when the cell is
empty? I need it to work when the cell = 0.

Thanks again.
Bob
 
Top