Possible to create a macro that changes formulas?

MickFlanagen

New Member
Joined
Jan 24, 2012
Messages
27
Good Morning,

I have an excel sheet that uses the Bloomberg Ad-in. We need this sheet to be "live" (which uses one formula) and historical (a different formula)

the two formulas look like this:

Live: =BDP("ticker","px_last")
Historical: =BDH("same ticker","px_last",date,date)

*all of the things in italics are cell references, and the formulas are all in one row

So here is what I'd like to create a macro for:

Once I no longer need the sheet to be "live" (using the BDP formula), it like to have a macro that converts it to historical (using the BDH formula).

I know I can use a find and replace macro to change the first bit (BDP to BDH), but how do I get it to add those two "date" references to the end?

Thanks in advance for the help, I hope this makes sense.

MF
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Forum statistics

Threads
1,216,730
Messages
6,132,395
Members
449,725
Latest member
Enero1

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