hello all,
i have a worksheet with column A-I, row 1-250.
however i'm not necessary to use every row every time.
the question is how can i simply set the print area automatically to last row thus i can use less paper?
it seems my code below will goto row 250 every time and i will print "blank sheet" out
thanks for everyone.
i have a worksheet with column A-I, row 1-250.
however i'm not necessary to use every row every time.
the question is how can i simply set the print area automatically to last row thus i can use less paper?
it seems my code below will goto row 250 every time and i will print "blank sheet" out
Code:
Dim LastRow As Long
LastRow = Range("A:I").SpecialCells(xlCellTypeLastCell).Row
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$" & LastRow
thanks for everyone.