Creating Print ( )

  • Thread starter Thread starter Pablo
  • Start date Start date
P

Pablo

I would like to create a print () that will find the last
item in the worksheet, set the page area for the row and
print the sheet. Is there any references that I could
walk me through this? I am sure my first bit of code
would be Range(A1).Select.

Thanks,
Pablo
 
Hi
Pablo
if you only want to print the last filled row of your active sheet try
the following

Sub print_last_row()
Dim rng As Range
Set rng = Cells(ActiveSheet.UsedRange.Rows.count, 1).EntireRow
ActiveSheet.PageSetup.PrintArea = rng.Address
ActiveSheet.PrintOut
End Sub
 

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