Hi Dave,
just for fun, and I wonder what your test results will show,
a much less smart approach than Doug's, kind of brute force:
Sub test()
' wdEndOfRangeColumnNumber = 17
' wdEndOfRangeRowNumber = 14
Dim r As Range
Dim iCll As Integer ' cell
Dim iRow As Integer ' row
ResetSearch
With Selection
If .Range.Text = .Cells(1).Range.Text Then
MsgBox "all of cell selected"
Exit Sub
End If
Set r = .Range
.Collapse direction:=wdCollapseEnd
iCll = .Information(17)
iRow = .Information(14)
With .Find
.Text = "<*>"
.MatchWildcards = True
.Execute
End With
If iCll <> .Information(17) Or iRow <> .Information(14) Then
r.Select
End If
End With
ResetSearch
End Sub
'---
Public Sub ResetSearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
End Sub
Have a nice day, both of you!
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/