Placing cursor in selected cell

D

Dave Neve

Hi

I'd like to add instruction to the macro below to place the cursor in the
selected cell.

I've tried to work it out using record macro but the mouse doesn't respond
in this mode.

Could sm be so kind as to add the line of code in .

Thanks

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, Selection.Tables(1).Columns.Count).Select
 
H

Helmut Weber

Hi Dave,

e.g. selection.homekey is probably
what you are lookong for, as the cell
is already selected, after macro execution.

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 

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