Can I use this code for 400 words what is needed to replace with spaces?
If a copy all those 400 words into "What = Array("")" line then all those 400 word become red(maybe it becomes red because all those 400 words in going in 9 rows)
What code can i use to replace 400 diffrents word with spaces?
[Select Code] copy to clipboard
Sub ExampleA()
Dim Rng As Range
Dim What As Variant
Dim Repl As Variant
Dim i As Long
What = Array("XYZ000001", "XYZ000002", "XYZ000004")
Repl = Array("ABC000123", "ABC000124", "ABC000125")
For i = 0 To UBound(What)
Set Rng = ActiveSheet.UsedRange
Rng.Replace What:=What(i), Replacement:=Repl(i), MatchCase:=False
Next i
End Sub
Bookmarks