E
E.Sortland
Hi, hopefully someone can point me in the right direction.
I'm having trouble making a macro for a variable size print area.
My code so far:
Range("B8").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.PageSetup.PrintArea = "$B$8:$H$273"
Range("G5").Select
In the example above when i create the macro i have text in the area from B8
to H273, but if my text changes, the macro still selects this range to
printarea, making the area either to big or to small.
I have tried using this command from another workbook, but the results are
not what I'm looking for:
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address
I'm having trouble making a macro for a variable size print area.
My code so far:
Range("B8").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
ActiveSheet.PageSetup.PrintArea = "$B$8:$H$273"
Range("G5").Select
In the example above when i create the macro i have text in the area from B8
to H273, but if my text changes, the macro still selects this range to
printarea, making the area either to big or to small.
I have tried using this command from another workbook, but the results are
not what I'm looking for:
ActiveSheet.PageSetup.PrintArea = ActiveCell.CurrentRegion.Address