 |
 |

01-29-2004, 07:52 AM
|
 |
Junior Contributor
|
|
Join Date: Apr 2003
Location: Montreal
Posts: 270
|
|
Getting the number of pages printing would give
|
Hey. Just trying to put the finishing touches on a little project at work. I've got a spreadsheet that prints to 11 x 17 paper. My boss wants me to write how many pages will be printed on the sheet somewhere, and I'm really not sure how to get that information. Any ideas?
|
|

01-29-2004, 07:58 AM
|
|
Newcomer
|
|
Join Date: Dec 2003
Posts: 12
|
|
Quote: Originally Posted by burningice96 Hey. Just trying to put the finishing touches on a little project at work. I've got a spreadsheet that prints to 11 x 17 paper. My boss wants me to write how many pages will be printed on the sheet somewhere, and I'm really not sure how to get that information. Any ideas?
If you go to File -> Page Setup -> Header / Footer -> In either the header or footer of the page you can show what page you're on, total pages, date, filename, and all that good stuff.
|
|

01-29-2004, 08:01 AM
|
 |
Junior Contributor
|
|
Join Date: Apr 2003
Location: Montreal
Posts: 270
|
|
|
Ok that's really cool. But what if I want to use that information in a specific place on the page (and not necessarily in the header). Is there a way I can extract that information?
|
|

01-29-2004, 08:27 AM
|
 |
Junior Contributor
|
|
Join Date: Apr 2003
Location: Montreal
Posts: 270
|
|
I made a macro to find out what the header does when I ask it to put up the page numbers and it gives me this:
Code:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "Page &P de &N"
And so on and so forth. But when I copy &P into text, it writes it as &P, and not the page number itself. Any thoughts?
|
|

01-29-2004, 09:54 AM
|
 |
Sapience.Aquire
Super Moderator * Expert *
|
|
Join Date: Oct 2003
Location: Lake Bluff, Ill., U.S.
Posts: 3,306
|
|
There wasn't a cell function that I could find that would return the number of printable sheets, so I made one:
Code:
Public Function NumPage() As Long
NumPage = (ActiveSheet.HPageBreaks.Count + 1) * (ActiveSheet.VPageBreaks.Count + 1)
End Function
|
__________________
No the other right mouse click
|

02-05-2004, 06:51 AM
|
 |
Junior Contributor
|
|
Join Date: Apr 2003
Location: Montreal
Posts: 270
|
|
|
That's perfect Kluz. Thanks a bunch!
|
|

02-05-2004, 02:27 PM
|
 |
Junior Contributor
* Expert *
|
|
Join Date: Dec 2002
Location: Auckland, New Zealand
Posts: 201
|
|
Quote: Originally Posted by burningice96 That's perfect Kluz. Thanks a bunch!
To get the number of pages to print then
Code:
Sub GetNoPgs_ToPrnt()
Dim dPages As Double
dPages = ExecuteExcel4Macro("GET.DOCUMENT(50)")
MsgBox dPages & " Pages will be printed"
End Sub
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|