Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

page numbering in a cell

5 views
Skip to first unread message

Dychell Edwards

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
Hi, does Excel have a way to insert page numbering inside cells? I want to
have the page X of Y look but not as a header or footer but inside a cell at
the top of my spreadsheet. I hope someone can answer this question. I have
searched all over the place.

Thanks

Myrna Larson

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
On Wed, 25 Aug 1999 14:28:07 -0700, "Dychell Edwards" <dedw...@shentel.net>
wrote:

I'm assuming the cell in question is in a print title row?

This problem came up a few weeks ago. The solution (from Dana DeLouis, as I
remember) for a workbook that prints one page wide and multiple columns high
went something like this:

Sub PrintWithPageNumber()
Dim NumPages As Long, P As Long

NumPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50")
For P = 1 To NumPages
Range("J1").Value = "Page " & P
ActiveSheet.Printout From:=p, To:=p
Next P
End Sub

If the workbook is more than one page wide, you'll have to put the page number
in multiple cells so the part of row 1 that's included on that page has the
number.


Myrna Larson

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
On Wed, 25 Aug 1999 19:19:39 GMT, myrna...@home.net (Myrna Larson) wrote:

> NumPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50")

Oops. There's typo there. Right parenthesis is missing. It should be:

NumPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")


0 new messages