set print area for multiple sheet at the same time

romeo16

New Member
Joined
Jul 20, 2016
Messages
21
I have a file that contains 25 worksheets w/ all same formatting.
Now, I need to set the print area to A1:N58 for sheets("firstone") and set the print area to A1:N40 for sheets("secondone"). I only know how to do this for 1 worksheet (activesheet) at a time. Below is what i used.

sheets("firstone").select
sheets("firstone").Range("A1:N58").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$58"



How do I apply the print area to all 2 sheets at the same time and then have all 2 worksheets printed at once?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,880
Office Version
  1. 2010
Platform
  1. Windows
Code:
[I]sheets("firstone").select
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$58"
[/I]ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = ""

[I]sheets("[/I][COLOR=#333333]secondone[/COLOR][I]").select
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$40"
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = ""
[/I]
 
Last edited:

romeo16

New Member
Joined
Jul 20, 2016
Messages
21
Code:
[I]sheets("firstone").select
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$58"
[/I]ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = ""

[I]sheets("[/I][COLOR=#333333]secondone[/COLOR][I]").select
ActiveSheet.PageSetup.PrintArea = "$A$1:$N$40"
ActiveSheet.PrintOut
ActiveSheet.PageSetup.PrintArea = ""
[/I]

Thanks for your reply , unfortunately I don't want to print them out right away , I want just to see them when I go in print preview?
 
Last edited:

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,880
Office Version
  1. 2010
Platform
  1. Windows
Thanks for your reply , unfortunately I don't want to print them out right away , I want just to see them when I go in print preview?
Didn't you write "have all 2 worksheets printed at once"?


You cannot open two preview windows at once. You have to close the first preview window before the second one appears.
Code:
Sheets("DIC42").SelectActiveSheet.PageSetup.PrintArea = "$A$1:$M$3"
ActiveSheet.PrintPreview (True)
'ActiveSheet.PageSetup.PrintArea = ""

Sheets("DIC52").Select
ActiveSheet.PageSetup.PrintArea = "$A$10:$M$12"
ActiveSheet.PrintPreview ()
'ActiveSheet.PageSetup.PrintArea = ""
 

romeo16

New Member
Joined
Jul 20, 2016
Messages
21
So you can't set the 2 worksheets to be displayed on one print preview window as 2 pages?
 

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,880
Office Version
  1. 2010
Platform
  1. Windows
You can copy the print areas to one sheet and see them in print preview.
 

romeo16

New Member
Joined
Jul 20, 2016
Messages
21
Thanks , I tried that and in print preview it's showing only the last sheet 's print area!
 

Forum statistics

Threads
1,171,689
Messages
5,876,917
Members
433,219
Latest member
mahendraalld92

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
Top