Specifying which specific page numbers to print

liampog

Active Member
Joined
Aug 3, 2010
Messages
316
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi there

I have 15 A4 sized pages within the spreadsheet and in the top corner of each page I have the following formula to "create" a page number if data is present on the sheet:

This code creates the number 1 (for Page 1):
Code:
=IF(AND((COUNTA(A3:A39)=0),SUM(Q3:Q41)=0),"IS BLANK",1)

This code creates the number 2 (for Page 2):
Code:
=IF(AND((COUNTA(A44:A80)=0),SUM(Q44:Q82)=0),"IS BLANK",2)

etc, etc for each page up to 15

Is there any way that I can have some way whereby my print macro button which is already set up can detect which pages have a page number (and don't equate to IS BLANK) and the print out those specific page numbers?

I know I can use Activesheet.Printout 1, 5 for the first page being 1 and the last page being 5, but this is useless in this particular example because pages 1 and 5 might have data on them but pages 2-4 will be empty.

I hope this explains my problem,
Liam
 
Last edited:

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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