ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro/Forumula to SUM values from Sheet that does not always exist (https://www.excelbanter.com/excel-worksheet-functions/445974-macro-forumula-sum-values-sheet-does-not-always-exist.html)

Livin

Macro/Forumula to SUM values from Sheet that does not always exist
 
I have a macro that creates Sheet9 as needed. On Sheet1 I need to SUM values
from Sheet9 when it exists.

Currently I use a basic formula but when the sheet gets automatically deleted
and recreated, using a macro, the formula errors and does not "fix" itself when
Sheet9 gets recreated.

I prefer to use a macro where I can specify a Sheet/Cell to place the SUM, when
Sheet9 exists... but if you have a formula that will stop if from erroring that
would work too.

thx for the help!

isabelle

Macro/Forumula to SUM values from Sheet that does not alwaysexist
 
hi Livin,

if you don't matter with #REF! error

=SUM(INDIRECT("Sheet9!A:A"))

else

=IF(ISERROR(SUM(INDIRECT("Sheet9!A:A"))),"",SUM(IN DIRECT("Sheet9!A:A")))

--
isabelle




Le 2012-05-04 19:36, Livin a écrit :
I have a macro that creates Sheet9 as needed. On Sheet1 I need to SUM values
from Sheet9 when it exists.

Currently I use a basic formula but when the sheet gets automatically deleted
and recreated, using a macro, the formula errors and does not "fix" itself when
Sheet9 gets recreated.

I prefer to use a macro where I can specify a Sheet/Cell to place the SUM, when
Sheet9 exists... but if you have a formula that will stop if from erroring that
would work too.

thx for the help!



All times are GMT +1. The time now is 05:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com