Supra_Edd
asked on
Macro to set print area within Excel
I have the following macro which set's the print area to just the rows and columns that have data, or results of formula's. This works fine, but now I need it to expand the print area to the row AFTER the last bit of data. Can't seem to make it work!
Thanks
Dim lastCell As Range
Set lastCell = Cells.SpecialCells(xlCellT ypeLastCel l).Offset( 1, 0)
Do Until Application.Count(lastCell .EntireRow ) <> 0
Set lastCell = lastCell.Offset(-1, 0)
Loop
ActiveSheet.PageSetup.Prin tArea = Range(Cells(1, 1), lastCell).Address
End Sub
Thanks
Dim lastCell As Range
Set lastCell = Cells.SpecialCells(xlCellT
Do Until Application.Count(lastCell
Set lastCell = lastCell.Offset(-1, 0)
Loop
ActiveSheet.PageSetup.Prin
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER