Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-14-2016, 08:36 AM
gmayor's Avatar
gmayor gmayor is offline How to find out if selection is in table Windows 10 How to find out if selection is in table 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

You can get the table and row from the selection
Code:
Dim oTable As Table
Dim iRow As Long
If Selection.Information(wdWithInTable) Then
    Set oTable = Selection.Tables(1)
    iRow = Selection.Rows(1).Index
    MsgBox "Selection in row " & iRow
Else
    MsgBox "Not in Table"
End If

__________________
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
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find out if selection is in table Find if the selection is a horizontal line NevilleT Word VBA 4 06-26-2016 12:17 AM
How to find out if selection is in table Help required with Selection.Find to search a text file. Marko Word VBA 2 10-18-2014 06:32 AM
VBA to Find and Format Text string defined using Inputbox within selection sistemalan Word VBA 7 10-03-2014 07:28 AM
Excel 2013 Alt F doesn't block selection in find anymore KatMagic Excel 0 03-15-2014 12:44 PM
Automatic find replace after selection in dropdown vsempoux Word 0 10-28-2009 08:45 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:59 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