user3651785
user3651785

Reputation: 21

How to select the text between the curs and end of a cell in Microsoft Word

I have a table in Microsoft Word. My cursor it's in the middle of a cell. I want, using vba, to select the text between the curs and the end of cell (NOT THE END OF THE LINE)

This is how you select the text between cursor and the end of the line

Selection.EndKey Unit:=wdLine, Extend:=wdExtend

Upvotes: 0

Views: 2229

Answers (1)

anishsane
anishsane

Reputation: 20980

Try this:

Sub setMySelection()
    Set mySelection = Selection.Range
    mySelection.SetRange mySelection.Start, Selection.Cells(1).Range.End - 1
    mySelection.Select
End Sub

Upvotes: 1

Related Questions