Set Print Ranges

RandyD123

Active Member
Joined
Dec 4, 2013
Messages
289
Office Version
  1. 2016
Platform
  1. Windows
The attached sheet is my sample. As you can see the there are 2 seperate tables on each sheet. Every so often I need to add more ROWS, I NEVER need to add more columns!!!

Is there a way to set a dynamic print range so that I can print each table individually, like it is now, but the exception being is if I had to add more rows the print range will adjust automatically?


OOOPS.....I guess I can't post attachements!
 
Last edited:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If you use the define name for your table ranges you can use a macro such as


Code:
Sub SetActivePrintAreas
ActiveSheet.PageSetup.PrintArea = "(This_Is_The_Table[#All]), (This_Is_Also_A_Table[#All])"
End Sub

Where This_Is_The_Table and This_Is_Also_A_Table are your named areas.
When you add more rows the table will update and the named areas will also update.
 
Upvote 0
Code:
Sub Print1()
'
' Print1 Macro
'
Sub SetActivePrintAreas()
ActiveSheet.PageSetup.PrintArea = "(Table1[#All])"
End Sub
Sub Print2()
'
' Print2 Macro
'
Sub SetActivePrintAreas()
ActiveSheet.PageSetup.PrintArea = "(Table2[#All]"
End Sub


This throws an error!!! I have a "Print" button object on each sheet and a macro assigned to each button.
 
Upvote 0
If I could send the file to you maybe you could help. I tried to do what you said but it didn't work!
 
Upvote 0

Forum statistics

Threads
1,214,383
Messages
6,119,198
Members
448,874
Latest member
Lancelots

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