Macro using relative references

W

warp9

I’m trying to record a macro using the relative reference option in order to
change the print area every time it’s run. The active cell offset reference
appears in the code, yet the print range defaults to the original print area
regardless of where the cursor is placed when the macro is run. What am I
doing wrong?
 
W

warp9

Thanks John.


ActiveCell.Offset(3, 0).Range("A1:M100").Select
ActiveSheet.PageSetup.PrintArea = "$A$701:$M$800"
 
J

John C

Your code is selecting A1:M100, but then printing A701:M800 only.

Change your second line to this:
ActiveSheet.PageSetup.PrintArea = Selection.Address

Hope this helps.
 
Top