Updating a summary sheet using VBA

srea

New Member
Joined
Jun 13, 2010
Messages
1
I have a workbook that contains several sheets that we use for forecasting and actuals tracking. One of the sheets is a monthly summary sheet; there is also a sheet for actuals and another for forecasting. Both the forecasting and actuals sheets are divided into months, i.e, Jan thru Dec and they are updated on a monthly basis. For example: this months actuals sheet would show the total spent on a project during following month and also months proceeding. The forecast sheet shows everything forecast to be spent for the several months in advance.

What I curently have is a simple formula that references the sum of the cell or cells in each respective sheet. The summary sheet totals both the actuals and the forecast and shows the total expected spend. The problem is that once a actual is posted for the month then the Forecast sumamry should no longer include the prior months forecast for that month. Example 10k is forecast for the month, but the 10k is now an actual and no longer a forecast so the formula has to be manually changed to exclude the amount that was forecast for that month. It looks like =SUM(Forecast!A2:L2), but now should be =SUM(Forecast!A2:k2), so lasts months forecast is no longer included in the Forecast. Is there a way to automate this using VBA or another formula?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Perhaps this may work, you may have to adapt this formula a bit to suit your needs.

Code:
=SUM(Forecast!A2:CHOOSE(MONTH(TODAY()),A2,B2,C2,D2,E2,F2,G2,H2,I2,J2,K2,L2))

Welcome to the MREXCEL msg board!!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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