Calculate formula while inserting and removing sheets

apr371

New Member
Joined
Dec 17, 2008
Messages
1
Hi,

I need to calculate formula in sheet1 taking values from others sheets.
For example I have a formula in sheet1 containing the cell A1 of others sheets (sheet2,sheet3,sheet4 only). If i remove any one sheet (ex. sheet3), then the formula should work taking remaining sheets (ie., sheet2, sheet4) and also when i insert a worksheet with the name sheet3. How can i achieve this? Can I use reference only or VBA / macro? Can any one help to sort out this problem? Thanks
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to the Board

just extending Yard's solution... if it's possible that either Sheet2 or Sheet4 may be deleted and replaced I would personally go for the insertion of 2 sheets... one called START and one called END... START would be placed before the first sheet to SUM and END placed after the last sheet to Sum (ie using present example you would have START,Sheet2,Sheet3,Sheet4,END) -- your formula on sheet1 thus becomes:

=SUM(START:END!A1)

Then even if either of Sheet2 / Sheet4 are removed the formula on Sheet1 is unaffected... ie the key is that the sheet "boundaries" (eg START/END) should be sheets that are never going to be removed.
 
Upvote 0

Forum statistics

Threads
1,216,759
Messages
6,132,556
Members
449,735
Latest member
Gary_M

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