Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2004

Tip: Looking for answers? Try searching our database.

location of cursor in multiple table document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 15 Jun 2004 09:10 GMT
Can anyone tell me how in vba to locate the cursor in a
table and document.

I have a document with multiple tables what i want is to
create a vba procedure that the user can use to
automatically enter a new row at the end of the specific
table they are using.

So i need to loacte the table number they are in and send
the cursor to the end of the table and insert the new row.

Any ideas

Paul
Jezebel - 15 Jun 2004 09:52 GMT
Selection.Tables(1)

You might need to allow for the possibility that the selection spans more
than one table.

> Can anyone tell me how in vba to locate the cursor in a
> table and document.
[quoted text clipped - 10 lines]
>
> Paul
Helmut Weber - 15 Jun 2004 09:56 GMT
Hi Paul,
just one of several way as a start:
Dim oRng As Range
Set oRng = Selection.Range ' remember selection
Selection.Tables(1).Select
Selection.InsertRowsBelow 1
oRng.Select ' restore selection
---
Adds a row at the end of the first table
that is touched by the selection. You might like
to collapse the selection beforehand or check,
whether the cursor touches a table at all, or just
do nothing by in case, using a on error command.
Let us know if you need more help on this.
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.