Sub numeroPage_Cellule_X()
Application.ScreenUpdating = False
ActiveWindow.View = xlPageBreakPreview
MsgBox numeroPage(Range("A51"))
ActiveWindow.View = xlPageLayoutView
Application.ScreenUpdating = True
End Sub
Function numeroPage(Cellule As Range) As Integer
Dim VPC As Integer, HPC As Integer
Dim VPB As VPageBreak, HPB As HPageBreak
Dim Wksht As Worksheet
Dim Col As Integer, Ligne As Long
Set Wksht = Cellule.Worksheet
Ligne = Cellule.Row
Col = Cellule.Column
If Wksht.PageSetup.Order = xlDownThenOver Then
HPC = Wksht.HPageBreaks.Count + 1
VPC = 1
Else
VPC = Wksht.VPageBreaks.Count + 1
HPC = 1
End If
numeroPage = 1
For Each VPB In Wksht.VPageBreaks
If VPB.Location.Column > Col Then Exit For
numeroPage = numeroPage + HPC
Next VPB
For Each HPB In Wksht.HPageBreaks
If HPB.Location.Row > Ligne Then Exit For
numeroPage = numeroPage + VPC
Next HPB
End Function