Restrict user from printing empty pages in excel vba

[Closed]
Report
-
 pooja -
Hello,

I have three print areas in a single sheet. If I print that sheet, it prints 3 pages(print areas). Is there any way to print only the print area(s) with data. I don't want to print empty print area(s). I need to done only through VBA. Does anyone have idea to achieve this?

Thanks in advance!

2 replies


Try to loop through this logic:
Sheets("Sheet2").Select
    Range("A3:G38").Select
    ActiveSheet.PageSetup.PrintArea = "$A$3:$G$38"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True


I have said it once, I will say it again. IT!
Thanks ac3mark!.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!