dyamic printing

H

hurlbut777

I have a spreadsheet with 10,000 rows available for entry. I would like to
create a print macro that would only print down to the last row that actually
had data instead of printing 1 billion pages of blank rows.

I need to know if this is possible using vba, and if so, what would the code
look like...not looking for alternative solutions.

Thanks,
Jeff
 
N

NOPIK

I have a spreadsheet with 10,000 rows available for entry.  I would like to
create a print macro that would only print down to the last row that actually
had data instead of printing 1 billion pages of blank rows.

I need to know if this is possible using vba, and if so, what would the code
look like...not looking for alternative solutions.

Thanks,
Jeff

Setup PrintArea as described in following post
ActiveSheet.PageSetup.PrintArea = "1:100"
ActiveSheet.PrintOut
 
O

Office_Novice

Option Explicit
Sub PrintYourRange()
Dim LastRow As Long
Dim YourRange As Range
LastRow = ActiveWorkbook.Worksheets(1).Cells(Rows.Count, 1).End(xlUp).Row
Set YourRange = Range("A1: I" & LastRow)
YourRange.Select
Selection.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

Top