I can't find out how to get the page number of any specific cell though.
Any help gratefully received.
if the file has been saved, then you could use =CELL("Filename")
you can use FIND and MID functions to extract the sheet name.
Microsoft Excel MVP
"tony bolding" <nospam...@atlantisuk.com> wrote in message
>I am trying to find out the page number of a particular cell so that I can
>create a page summary.
>I can't find out how to get the page number of any specific cell though.
>Any help gratefully received.
If you mean the page number if the current sheet were to be printed, then this
requires a macro, and it's, in fact, quite lengthy. I have developed a macro
which does the equivalent of Word's Print Current Page. If you are interested
in some code, let me know.
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
VPC = ActiveSheet.VPageBreaks.Count + 1
HPC = 1
NumPage = 1
For Each VPB In ActiveSheet.VPageBreaks
If VPB.Location.Column > ActiveCell.Column Then Exit For
NumPage = NumPage + HPC
For Each HPB In ActiveSheet.HPageBreaks
If HPB.Location.Row > ActiveCell.Row Then Exit For
NumPage = NumPage + VPC
MsgBox "Page number of the active cell = " & NumPage