How do I print hidden pages?

  • Thread starter Thread starter Bafa
  • Start date Start date
B

Bafa

I am using:
Worksheets("Print Data").PageSetup.PrintArea = "$A$1:$J$40"
Worksheets("Print Data").PrintOut

This works fine until I hide the "Print Data" page and then I get a
error. What can I do to fix it
 
Hidden sheets will not print, as you have discovered. You must make the
sheet Visible long enough to run the print code, and then hide it again. For
example:
Sub Print_Data()
Application.ScreenUpdating = False
Worksheets("Print Data").Visible = True
Worksheets("Print Data").PageSetup.PrintArea = "$A$1:$J$40"
Worksheets("Print Data").PrintOut
Application.ScreenUpdating = True
Worksheets("Print Data").Visible = False
End Sub

Mike F
 
OOPS! reverse the order of the last 2 lines to prevent the sheet tab from
showing.

Worksheets("Print Data").Visible = False
Application.ScreenUpdating = True
End Sub


Mike F
 

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

Back
Top