I am using this function:
Public Function replaceWord(t As String)
For Each c In Columns(1).SpecialCells(2)
t = Replace(t, c.Value, c.Offset(0, 1).Value)
Next
replaceWord = t
End Function
to replace values.
Like this:
So the function work like this, it checks if values in column C are also in column A. If found it, is going to replace it with values in column B.
I would like to adjust this function so only if exact values in column A are found then do the replacement. Like in the picture, where text in column C becomes text in column E, so "a b abaaa", as the value"abaaa" is not present in column A.
At the present the function does this, which is wrong, as value "abaaa" should not be replaced it:
Hope this is clear enough!
Aucun commentaire:
Enregistrer un commentaire