I can't find out how to get the page number of any specific cell though.
Any help gratefully received.
Regards
Tony.
if the file has been saved, then you could use =CELL("Filename")
you can use FIND and MID functions to extract the sheet name.
--
Patrick Molloy
Microsoft Excel MVP
www.xl-expert.com pat...@NOSPAMxl-expert.com
_________________________________
"tony bolding" <nospam...@atlantisuk.com> wrote in message
news:38fd...@news.server.worldonline.co.uk...
>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
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
Laurent
Laurent