Solved VBA to look for similar words

July 17, 2015 at 23:07:04
Specs: Windows 7

I am new to VBA and am trying to find a VBA to match & copy words with similarity from 2 different sheets.
The code provided below was very useful but it didn't return any result when the following occurs
Lookup cell : ABC. PTE LTD (sheet 3)
Datasource: ABC PTE LTD (sheet 1)
Lookup cell: Telecommunications Pte Ltd
Datasource: Telecommunication Pte Ltd

is there a way to modify the VBA where it matches the pattern but need not have to be exact match & return result? Will appreciate your help!

Sub carHunter()
'Determine last row with data in Sheet 3 Column A
lastSrc_rw = Sheets(3).Range("A" & Rows.Count).End(xlUp).Row
'Loop through list of cars
For Each car In Sheets(3).Range("A1:A" & lastSrc_rw)
'Search for each car, copy row if found
With Sheets(1).Columns(11)
Set c = .Find(car, LookIn:=xlValues, lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
'Find next open row in Sheet 2
nxtDst_rw = Sheets(2).Range("A" & Rows.Count).End(xlUp).Row + 1
'Copy row containing found car
c.EntireRow.Copy Destination:=Sheets(2).Range("A" & nxtDst_rw)
'Search for same car again, stop when no more found
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub

See More: VBA to look for similar words

Report •

July 18, 2015 at 13:48:45
✔ Best Answer
This is not VBA, but you may find it helpful:


Report •
Related Solutions

Ask Question