Print Area

  • Thread starter Thread starter JT
  • Start date Start date
J

JT

I want to set the print area with my macro. If I know the
ending row, I can use the following formula:

ActiveSheet.PageSetup.PrintArea = "$A$1:$L$101"

However. the last row will be different every time. It
will always be column L.

Is there a better way to do this? Any help or suggestions
would be apprecatiated. Thanks.
 
One way:

With ActiveSheet
.PageSetup.PrintArea = .Range(.Cells(1, 1), _
.Cells(.Rows.Count, 12).End(xlUp)).Address
End With
 

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