Reputation: 21
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
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