Macro to convert formulas from 1 syntax to another

Foodo

New Member
Joined
Dec 22, 2015
Messages
20
Hello Excel Gurus,

I am trying to write a macro which will search through an entire worksheet for a specific formula (excel add-in) and replace it with another special formula (excel add-in). The added twist is that the syntax for each formula is different. Details as follows:

Formula A syntax "=FORMA(A,B,C,D)"
Formula B syntax "=FORMB(Param1#B;Param2#C;Param3#A;Param4#D,Param5#E)" whereby A,B,C,D parameters are same as from Formula A

Note in Formula B, the parameters are separated by a ";" as opposed to a "," and each parameter is defined (e.g., Param1#, etc.).

My original thought was to use InStr to find relative positions of the "," in Formula A and essentially define Dim's for each of the parameters in Formula A and then create a script that will insert Formula B using the Dim's.

Suggestions much appreciated.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
If I break the issue to several components, one obstacle appears to be replacing "," with ";". For some reason, the replace function does not like the ";". I tried to get around this by declaring a DIM using Chr(59) but still did not work.

I suppose I could use good old Ctrl+H but would prefer not to if possible since I am trying to create a self contained macro for users to run. Suggestions / tips on this component?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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