How to Avoid Printing Blank Rows

  • Thread starter Thread starter Yogesh
  • Start date Start date
Y

Yogesh

Hi All,

How do i avoid printing blank rows in a Selected Range of cells using
VBScript.

Thank you,
 
Dim rng as range
On error resume Next
set rng = Selection.Specialcells(xlBlanks)
On error goto 0
if not rng is nothing then rng.EntireRow.Hidden = True
Selection.Printout
if not rng is nothing then rng.EntireRow.Hidden = False
 
Back
Top