Selecting text inside a cell

F

FHSchmid

I want to copy the text in a cell where the cursor is to another document. I
know how to copy to the other document. I do not know how to select all the
text in the cell where my cursor is.
Thanks for your help.
Fred
 
D

Doug Robbins - Word MVP

Dim rng as Range
Set rng=Selection.Cells(1).Range
rng.End = rng.End - 1 'strips off the end of cell marker

rng will now contain the text from the cell.

There may be no need to use copy. In the other document, you can just use
rng.Text

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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