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

page number in body?

63 views
Skip to first unread message

Matt

unread,
Jun 11, 2002, 1:20:23 PM6/11/02
to
Is it possible to have the page number in the body of a
worksheet? I've tried using &[PAGE] and &[PAGES] but no
luck.

TIA,
Matt

Ron de Bruin

unread,
Jun 11, 2002, 3:32:57 PM6/11/02
to
File - pagesetup
headers and footers

see the dropdownlist for a pagenumber

Regards Ron

"Matt" <mcim...@itwanchor.com> schreef in bericht
news:e70d01c2116c$451c06c0$35ef2ecf@TKMSFTNGXA11...

ikr

unread,
Jun 11, 2002, 5:02:51 PM6/11/02
to
Won't that just put it in the header or footer? I assume that Matt wants it
in the body - i.e. in a cell.

"Ron de Bruin" <ronde...@kabelfoon.nl> wrote in message
news:uYs0x6XECHA.2572@tkmsftngp05...

Ron de Bruin

unread,
Jun 11, 2002, 5:18:59 PM6/11/02
to
you are right about that.

He need VBA to do it

maybe he can make somthing with this
it will give the number from the page where the activecell is.
he can assign the NumPage to a cel on the sheet

Regards Ron


Sub PrintCurrentPage()
Dim VPC As Integer, HPC As Integer
Dim VPB As VPageBreak, HPB As HPageBreak
Dim NumPage As Integer

If ActiveSheet.PageSetup.Order = xlDownThenOver Then
HPC = ActiveSheet.HPageBreaks.Count + 1
VPC = 1
Else
VPC = ActiveSheet.VPageBreaks.Count + 1
HPC = 1
End If
NumPage = 1
For Each VPB In ActiveSheet.VPageBreaks
If VPB.Location.Column > ActiveCell.Column Then Exit For
NumPage = NumPage + HPC
Next VPB
For Each HPB In ActiveSheet.HPageBreaks
If HPB.Location.Row > ActiveCell.Row Then Exit For
NumPage = NumPage + VPC
Next HPB
MsgBox "Page number of the active cell = " & NumPage
End Sub

"ikr" <rip...@btinternet.com> schreef in bericht
news:ejk6ktYECHA.2324@tkmsftngp03...

Matt

unread,
Jun 12, 2002, 8:03:56 AM6/12/02
to
Thanks I'm going to try that out.


Regards,
Matt

0 new messages