Printing -- Page Number Continuity

D

doodles82a

If I develop three blocks of print programming in VBA where:

1st Block Prints 4 pages
2nd Block Prints 3 more pages
3rd Block Prints 7 more pages

then, is it possible for the page numbers for the three different sets
of print commands to be sequential (1 thru 14)?

Currently, my first print block produces four pages,numbered 1 thru 4.
My second print block produces three pages, numbered 1 thru 3. And my
third print block produces seven pages, numbered 1 thru 7.

Ideally, I'd like the first print block to produce four pages numbered
1 thru 4, the second print block to produce three pages numbered 5 thru
7, and the third print block to produce seven pages numbered 8 thru 14.


Might anyone have any ideas? Thanks.

Michael
 
R

Ron de Bruin

Try it like this

The space is importent after the 4 (bug)

Sub test()
With ActiveSheet.PageSetup
Range("a1:G204").PrintPreview
.LeftHeader = "&P+4 "
Range("a400:G500").PrintPreview
End With
End Sub
 
D

doodles82a

Thanks Ron. I failed to mention an important part of my problem. The
number of pages in each print block is dynamic, rather than static.
That is, I don't know for sure the number of pages that each print
block will produce. I used 4 pages, 3 pages, and 7 pages to illustrate
my need. In fact, I won't know whether the first print block will
produce 4 pages or 6 pages. Assuming that x number of pages are printed
from the first print block, I'd like the numbering for the second block
of print pages to begin at x+1. And if the second print block produces
y additional pages, then I'd like the numbering for the third block to
begin at x+y+1.

I'm sorry for leaving out the most important part of my dilemma.
 
J

Jim Rech

Assuming you have to print each block separately, after you set each block
as the print_area you could run this XL4 code:

Dim Pgs As Integer
Pgs = Application.ExecuteExcel4Macro("get.document(50)")

to see how many pages will be printed. And start with that number plus 1
for the next block.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top