Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-18-2019, 05:58 AM
gmayor's Avatar
gmayor gmayor is offline Identify current column on a page Windows 10 Identify current column on a page Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
 

Tags
columns, count, information



Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify current column on a page Return nameof Left column in current view trevorc Excel Programming 7 09-19-2018 08:38 PM
Identify current column on a page 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft