Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-15-2023, 08:54 PM
AlanCantor AlanCantor is offline Select a table in Word Windows 10 Select a table in Word Office 2019
Competent Performer
Select a table in Word
 
Join Date: Nov 2020
Posts: 153
AlanCantor is on a distinguished road
Default Select a table in Word

I'm trying to develop a script to select an entire table in Word, but only if the insertion point (cursor) is within the table. If the insertion point is NOT within a table, I want the script to signal an error.




I have a working prototype, but it's not quite right. The code selects just one column, not the entire table.

Sub SelectThisTable()

On Error GoTo ErrorHandler

Selection.SelectColumn

' Do something with the selected table

Exit Sub
ErrorHandler:

MsgBox "Not in a table"
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select a table in Word How to Select All or Part of a Table in Word jeffreybrown Word VBA 2 09-03-2018 08:23 PM
Looking to copy select cells in table using dropdown list to paste to new table in another worksheet CaptainRetired Excel Programming 18 01-04-2018 07:22 PM
VBA Word Table - Select More than 1 Column at a time - Apply Formatting jc491 Word VBA 12 09-24-2015 06:03 AM
Select a table in Word Can't select a cell in my table dilorenzoc Word Tables 1 06-03-2015 05:56 AM
Select a table in Word Select Text in Table but Table Gets Selected Too RBusiness Word 1 06-07-2011 04:26 PM

Other Forums: Access Forums

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