VBA code for changing formula reference inside cell

redpoll

New Member
Joined
Jun 3, 2015
Messages
10
Hi,

I have a Sheet1 where i.e. Column C is January, Column D is February etc. and different rows include different expense categories during that specific month.

I have a summary table on Sheet2 that I update each month which combines all the information I need. At the moment I have to update cell references on Sheet2 each month and am looking for a VBA code to do this task for me.

My question is, when the month is over, how can I change i.e. "=Budget!AK25" on cell A1 to "=Budget!AL25" using VBA code so that i could run it each month and the reference would be changed one column to the right.

Thanks for your help in advance!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi,

What you're asking is doable but there are easier ways. Try this


=OFFSET(Budget!AK25,0,A1)

If A1 contains 0 (Zero) the formula returns AK25 but enter a 1 and it returns AL25 etc.
 
Upvote 0

Forum statistics

Threads
1,203,096
Messages
6,053,516
Members
444,669
Latest member
Renarian

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