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
 
Back
Top