Multiple Substitute from list in VBA

jsturm

New Member
Joined
Sep 27, 2018
Messages
11
Overview: I am trying to run a mass substitution of a large list of terms by looping a Substitute function via VBA. Details below. and a link to a possible idea for a solution I found elsewhere is below the image here. Perhaps can help.

I have a list with two columns in my 'Job Title Append' sheet. In this sheet, Column B is 'Old Text' Column C is 'New Text' Image Below.

In a separate 'Processed Compilation Tab' Sheet i have a set of data that I want to search and replace any matches from 'Old Text' with 'New Text' in the same row.
I have 300 and counting rows in the Old Text>New Text list so using VBA is only option as formula requires too many nesting.

Also, some of the Old Text>New Text substitutions will rely on case sensitive and partial string replacements so it seems doing Substitute function in VBA is the best choice.
Also if possible I would like to choose which columns in the 'Processed Compilation Tab' sheet that the Substitute vba runs on in the Data Sheet. (So that I can choose for it not to affect certain columns basically.)

8a8204


___________________________________________________________________________________________________________________

I actually found this thread on a forum that seems exactly what I am trying to do but I am not sure if it does exactly what I have in mind or how to customize it to what I need. (Code provided as solution in this thread is way down at the bottom.)

https://www.ozgrid.com/forum/forum/...iple-substitute-or-replace-text-using-a-table
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top