How to Avoid Printing Blank Rows

Y

Yogesh

Hi All,

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

Thank you,
 
T

Tom Ogilvy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top