Public Sub PrintCurrentPage()
Dim PageNumber As Long
PageNumber = PageNumberOf(ActiveCell),
s.PrintOut From:= PageNumber , To:=PageNumber
End Sub
Function PageNumberOf(c As Range) As Long
Dim s As Worksheet
Set s = c.Worksheet
Dim ActiveRow As Long, ActiveCol As Long
ActiveRow = c.Row
ActiveCol = c.Column
Dim i As Long
Dim PageRow As Long
PageRow = 1
Dim HPBCount As Long
HPBCount = s.HPageBreaks.Count
For i = 1 To HPBCount
If ActiveRow < s.HPageBreaks(i).Location.Row Then
Exit For
Else
PageRow = PageRow + 1
End If
Next
Dim PageCol As Long
Dim VPBCount As Long
VPBCount = s.VPageBreaks.Count
PageCol = 1
For i = 1 To VPBCount
If ActiveCol < s.VPageBreaks(i).Location.Column Then
Exit For
Else
PageCol = PageCol + 1
End If
Next
Dim PageNumber As Long
If s.PageSetup.Order = xlDownThenOver Then
PageNumber = (s.HPageBreaks.Count + 1) * (PageCol - 1) + PageRow
Else
PageNumber = (s.VPageBreaks.Count + 1) * (PageRow - 1) + PageCol
End If
PageNumberOf = PageNumber
End Function