Hi i found the macro online and did little changes to it, it works great, but i need an adjustment so that it will match whole word only.
Here is my VBA:
If i try to replace word "put" by word "insert" it will also turn word "input" into word "inreplace" and that's what i want to avoid by applying match only whole word function which for some reason isn't included in excel.
Anyone of you excel wizards know how to tweak my vba to make it work that way?
Here is my VBA:
Code:
Sub Multi_FindReplace()
'PURPOSE: Find & Replace a list of text/values
Dim sht As Worksheet
Dim fndList As Integer
Dim rplcList As Integer
Dim tbl As ListObject
Dim myArray As Variant
'Create variable to point to your table
Set tbl = Worksheets("List Of Locations To Rmove").ListObjects("Table1")
'Create an Array out of the Table's Data
Set TempArray = tbl.DataBodyRange
myArray = Application.Transpose(TempArray)
'Designate Columns for Find/Replace data
fndList = 1
rplcList = 2
'Loop through each item in Array lists
For x = LBound(myArray, 1) To UBound(myArray, 2)
If sht.Name = "KWs Cleaning Sheet" Then
sht.Cells.Replace What:=" " & myArray(fndList, x), Replacement:=myArray(rplcList, x), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, _
SearchFormat:=False, ReplaceFormat:=False
End If
Next sht
Next x
End Sub
If i try to replace word "put" by word "insert" it will also turn word "input" into word "inreplace" and that's what i want to avoid by applying match only whole word function which for some reason isn't included in excel.
Anyone of you excel wizards know how to tweak my vba to make it work that way?