AutoComplete Method Example

This example returns the AutoComplete match for the string segment “Ap." An AutoComplete match is made if the column containing cell A5 contains a contiguous list and one of the entries in the list contains a match for the string.

s = Worksheets(1).Range("A5").AutoComplete("Ap")
If Len(s) > 0 Then
    MsgBox "Completes to " & s
Else
    MsgBox "Has no completion"
End If