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 2005

Tip: Looking for answers? Try searching our database.

Moving cursor in table to last cell in line

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave Neve - 27 Jun 2005 10:09 GMT
Hi

I'd like to develop the following macro to do certain things in addition.

1    After two seconds, to move the cursor across to the last cell
     in the line chosen (thereby deselecting the first cell)

The macro as it stands is as follows (thanks to Helmut)
Sub RandomPick()
'
' RandomPick Macro
' Macro créée le 18/06/2005 par Dave Neve
'
Dim i As Long
Dim j As Long
i = Selection.Tables(1).Rows.Count
Randomize
j = Int((i * Rnd) + 1)
Selection.Tables(1).Cell(j, 1).Select

End Sub

As always, I'd be grateful if sm can give me a line or two of code.

Dave Neve
Chuck - 27 Jun 2005 11:49 GMT
Does this work for you?

Selection.Tables(1).Cell(j, Selection.Tables(1).Columns.Count).Select

> Hi
>
[quoted text clipped - 21 lines]
>
> Dave Neve
 
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.