Find print area when no print area set

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a worksheet that is shown in page break preview view.

The heavy blue outline shows the boundary of what is shown in a print preview.

There is no print area set. I would like a macro that would find the address
of this blue boundary and set it to the print area.

How can this be done?

Thanks
 
Range("A1").SpecialCells(xlLastCell).address will give you the bottom right
cell used.
 
Found it!

ActiveSheet.PageSetup.PrintArea = ActiveSheet.UsedRange.Address

So simple!
 

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