VBA code to select print range

SaraB802

New Member
Joined
Feb 7, 2013
Messages
34
Having looked through a number of posts I am unable to find code to help. The problem is I need to select a print range on a rolling 13 week basis based on the columns. Currently the page is set up to repeat column A which contains the headings/categories on every page. I need to change which columns are also printed next to it based on which is the last column that has data in row 61. The first 13 weeks run from Col B to Col AA (each week has 2 columns), when week 14 is populated the range would need to be Col D to Col AC, reme,ber I still need to have Col A in both instances. So the range will be the last populated column -26 columns to the last populated column.

To make things more difficult if the column which is blank in row 61 is less than Col AA I still need to print Col B to Col AA and Col A.

I hope that makes sense.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

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