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
"NOPIK" wrote:
> On Sep 10, 7:55 pm, hurlbut777 <hurlbut...@discussions.microsoft.com>
> wrote:
> > 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
>
|