Moving cursor in table to last cell in line

D

Dave Neve

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
 
C

Chuck

Does this work for you?

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top