![]() |
|
#2
|
||||
|
||||
|
wdEndOfRangeColumnNumber relates to tables as you have discovered however following that line of thought you could use instead the horizontal page position to determine where the cursor or range is e.g. as in the following function. The three figures are the horizontal page positions of the three left margins.
Code:
Function WhichPageCol(oRng As Range) As Long
Select Case True
Case oRng.Information(wdHorizontalPositionRelativeToPage) >= 72 And _
oRng.Information(wdHorizontalPositionRelativeToPage) <= 316.5
WhichPageCol = 1
Case oRng.Information(wdHorizontalPositionRelativeToPage) >= 316.5 _
And oRng.Information(wdHorizontalPositionRelativeToPage) <= 561
WhichPageCol = 2
Case oRng.Information(wdHorizontalPositionRelativeToPage) >= 561
WhichPageCol = 3
End Select
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
| Tags |
| columns, count, information |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Return nameof Left column in current view
|
trevorc | Excel Programming | 7 | 09-19-2018 08:38 PM |
Table adding cells to previous page with room still on current page.
|
gedet | Word | 1 | 01-03-2018 10:35 AM |
| Identify last blank cell in column | mbesspiata | Excel | 0 | 02-27-2015 11:29 AM |
| How to save the current page in a new file with all the page settings (header, footer | Jamal NUMAN | Word | 6 | 03-15-2012 03:27 PM |
| Is there a way to automatically highlight the column and the row that of the current | Jamal NUMAN | Excel | 8 | 02-14-2012 02:58 PM |