Using names ranges to set print area in a macro
This is one way to name your print range:
Sub test()
Range("a1").Offset(Cells.SpecialCells(xlCellTypeLa stCell).Row + 1,
0).End(xlUp).Select
Range(Cells(1, 1), Cells(ActiveCell.Row, Range("s1").Column)).Name =
"rgPrint"
End Sub
"Dave Compton" wrote:
Hi all,
Hope somebody can help me out!
I would like to run a macro to set a print area.
I need to print columns A thru S only.
I need to define the bottom row of the print area to be the last row
before column A becomes blank.
(The length of the list of data is dynamic, therefore I cannot use a
static range. I wish to omit any row below the point when column A
becomes blank, and I am unable to sort the data in anyway.)
I was thinking of using an IF statement inside a named range.
Any ideas?
Thanks in advance.
|