In past had found solution to issue, requested by another member and published in mrexcel, but I cannot locate it any more. So here is my request for Macro:
Find & Replace macro :
EVERYTHING IS IN A SINGLE SHEET
- read txt in cell in column A
- find if same txt exists in *any* cell in column D (loop all D)
- write new txt in cell in column C euqal to txt found in cell in B which is adjacent to our cell in column A (pairs A / B contain FIND (A) and REPLACE BY (B)
- repeat by next cell in column A
- end when ALL cells in column A have been dealt with
Explanation of example:
Columns A and B contain the pairs of FIND (col A) and REPLACE BY (col B)
Column D contains the original texts to be replaced
Column C contains the end result provided by the Find & Replace process
Hope some kindred spirit may assist here.
Thanks!
PS: OUCH : title of thread wrong! Should read:
Find & Replace VBA - read txt in cell in column A, find if same exists in any cell in column D, replace it in C with txt found in adjacent cell in column B
Find & Replace macro :
EVERYTHING IS IN A SINGLE SHEET
- read txt in cell in column A
- find if same txt exists in *any* cell in column D (loop all D)
- write new txt in cell in column C euqal to txt found in cell in B which is adjacent to our cell in column A (pairs A / B contain FIND (A) and REPLACE BY (B)
- repeat by next cell in column A
- end when ALL cells in column A have been dealt with
MREXCEL-find-replace-2023-03-23-A.xlsx | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | CATEGORY-ORIGINAL | Category-processed | Category-processed | CATEGORY-ORIGINAL | ||
2 | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | Compressor Air & Water Aftercoolers | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||
3 | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | Air Compressor Accessories | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||
4 | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | Air Compressor Separator Kits | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||
5 | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | Air Compressor Parts Kits | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||
6 | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | Air Compressor Portable Air Tanks | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||
7 | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||||
8 | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||||
9 | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||||
10 | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||||
11 | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||||
12 | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||||
13 | Compressor Air & Water Aftercoolers | Compressors, Air Tanks & Pneumatic Tools > Air and Water Aftercoolers | ||||
14 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
15 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
16 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
17 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
18 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
19 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
20 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
21 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
22 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
23 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
24 | Air Compressor Accessories | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories | ||||
25 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
26 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
27 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
28 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
29 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
30 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
31 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
32 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
33 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
34 | Air Compressor Separator Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Compressor Separator Kits | ||||
35 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
36 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
37 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
38 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
39 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
40 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
41 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
42 | Air Compressor Parts Kits | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Parts Kits | ||||
43 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
44 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
45 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
46 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
47 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
48 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
49 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
50 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
51 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
52 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
53 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
54 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
55 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
56 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
57 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
58 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
59 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
60 | Air Compressor Portable Air Tanks | Compressors, Air Tanks & Pneumatic Tools > Air Compressor Accessories > Portable Air Tanks | ||||
Sheet1 |
Explanation of example:
Columns A and B contain the pairs of FIND (col A) and REPLACE BY (col B)
Column D contains the original texts to be replaced
Column C contains the end result provided by the Find & Replace process
Hope some kindred spirit may assist here.
Thanks!
PS: OUCH : title of thread wrong! Should read:
Find & Replace VBA - read txt in cell in column A, find if same exists in any cell in column D, replace it in C with txt found in adjacent cell in column B