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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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