Wild Card Search

F

fi.or.jp.de

Hi All,

I have workbook with 10k row.

I need to match with these cell with another column and get result.

For Eg.,
Sheet 1
Col A Col B
Bristol B Cheddar
Gloucester The Road

sheet2
Col A
Bristol - If Cell value match with sheet1 col A data get me col B
data
in sheet2.

I need to match all possible way

If the value is
"Bristol" - Its match
"Bristol B" - its match
"Brist" - its match
"tol B" - its match

I need all the types matches in vba, Pls guide me to get the output.
 
L

Luke M

Assuming your data starts in row 2, you can use this array** formula:

=INDEX(Sheet1!B2:B10000,MATCH(TRUE,ISNUMBER(SEARCH(A2,Sheet1!A2:A10000)),0))

**Use Ctrl+Shift+Enter to confirm formula, not just Enter.

Note that if you want this to be case-sensitive, replace SEARCH with FIND.
 
R

Rick Rothstein

Something like this should work for you...

Dim R As Range
Set R = Worksheets("Sheet1").Columns("A").Find(Worksheets("Sheet2"). _
Range("A1").Value, LookAt:=xlPart, MatchCase:=False)
If Not R Is Nothing Then
Worksheets("Sheet2").Range("B1").Value = R.Offset(, 1).Value
End If

Change the A1 and B1 references to match the actual cell addresses you are
using on Sheet2.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top