Changing formulae in VBA code????

VBA Virgin

New Member
Joined
Sep 7, 2011
Messages
3
Hello,

I'm quite new to this VBA language and I am struggling with the updating of formulae in code. Can anyone help????

I have a formulae in a workbook that refers to another sheet in the same workbook. The formulae looks like this:

='sheet 1'!BH32/'sheet 1'!BH9*5

So in the VBA code I need to update the formulae each week to refer to the next cell along i.e. if the reference is to cell BH this week I need it to be changed to cell BI next week in the workbook using code.

How can I do this???

Any suggestions greatly received!! :confused:
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi Andrew,

Thanks for your reply - I'm really sorry but as I'm not well versed in this, how do you mean ' use edit/replace looking in formulas'?
 
Upvote 0
Select your formulas, choose Edit|Replace from the menu, enter BH in the What box, enter BI in the With box, check Formulas in Look in and click Replace All. If you turn on the macro recorder before doing it you will get some VBA code.
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,862
Members
452,948
Latest member
UsmanAli786

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