Print Range Macro

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

I need a macro that will automatically find the row with
the last entry and set the print range to that row and
then print. Assuming columns A through D will contain
data, what would the VBA code look like? Thanks.
 
if you remove the Print_Area definition in the Names, then printing the
sheet should do what you want.

otherwise

Dim rng as Range
set rng = Cells(rows.count,1).end(xlup)
Activesheet.PageSetup.Printarea = _
range("A1",rng.offset(0,3)).Address(external:=True)
 

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