tags:

views:

106

answers:

1

Say I have a range of data from A1:Y55 containg data like "123 UID"

I am looking for a unique substring (in this case, the UID) in that range, how do I do this?

+3  A: 

You can do this with the following code.

On Error Resume Next

Range("A1:Y55").Find(What:="UID", After:=ActiveCell, LookIn:=xlFormulas, _
    LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
    MatchCase:=False, SearchFormat:=False).Activate

The error statement will allow the program to continue if it does not find any matches.

Irwin M. Fletcher