Created
November 30, 2016 06:43
-
-
Save alezhu/a3ef85c0be7bc817cac5c004c8a9533f to your computer and use it in GitHub Desktop.
Page number for cell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function GetCellPage(ra As range) As Long | |
Dim ws As Worksheet | |
GetCellPage = 0 | |
Set ws = ra.Parent | |
Dim iRow As Long | |
If ws.HPageBreaks.Count > 0 Then | |
iRow = ra.Row | |
Do | |
GetCellPage = GetCellPage + 1 | |
If GetCellPage > ws.HPageBreaks.Count Then | |
Exit Do | |
End If | |
Loop While ws.HPageBreaks.Item(GetCellPage).Location.Row <= iRow | |
End If | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment