VBA sets print margins for 9 pages, but they don't print in the right order

UncleBajubjubs

Board Regular
Joined
Jul 11, 2017
Messages
111
Office Version
  1. 2010
Hello, I have code to set the print margins on an excel sheet with 9 sheets printed. The code is the following:


<code>
ActiveSheet.PageSetup.PrintArea = "$A$14:$P$87,$A$88:$P$155,$A$162:$P$221,$Q$14:$AE$87,$Q$88:$AE$155,$Q$162:$AE$221,$AG$14:$AV$87,$AG$88:$AV$155,$AG$162:$AV$221"
</code>

Which I would think would make it print like
1 4 7
2 5 8
3 6 9

But it instead prints
1 3 7
2 4 8
5 6 9


Any suggestions?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
The order in which you specify the address string of the print range has no affect on the order in which it prints. Excel will print down then across, or across then down; that's it.

If you need something different, set the first page print area, print, second page, print, ...
 
Last edited:
Upvote 0
I tried switching it to 'across, then down' as it was already on 'down, then across', and now they order is


1 2 7
3 4 8
5 6 9

Neither option is doing what it should be doing.
 
Upvote 0
So ...

If you need something different, set the first page print area, print, second page, print, ...
 
Upvote 0
Or hide col AF and set the print area to $A$14:$AV$155, $A$162:$AV$221
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top