Dynamic Print Range Macro?
Posted by Travis Harr on September 25, 2001 12:36 PM
I am trying to create a simple macro that sets the print range so that if the number of rows changes, the macro will expand to print all rows the range.
The problem is that when I record the macro it hard codes the print area to look like below.
Sub Macro1()
Range("A1").Select
Selection.End(xlDown).Select
Range("A5:E1").Select
ActiveSheet.PageSetup.PrintArea = "$A$5:$E$1"
End Sub
Is there a way to dynamically change the print range So that instead of starting at "A5" (in this case) it would start where the "xlDown" ends?
Any help is greatly appreceated