ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Calling name of Sheet as a Variable? (https://www.excelbanter.com/excel-worksheet-functions/252191-calling-name-sheet-variable.html)

thekeytothedoor

Calling name of Sheet as a Variable?
 
I'm working on a home budget, and I've made 26 sheets (labeled 1-26, aptly).
Each of the sheets calls the previous information from the other sheets, and
if I change something (say add a cost of 100 dollars to one column), it
retroactively affects the other sheets. It took a long time for me to
physically go in and change the equations on each sheet to call the previous
sheet - every time i have to make a change, i have to change 26 sheets.

Example:
= '1'!F20 + D20 - E20 on '2'
= '2'!F20 + D20 - E20 on '3'
etc...

I was wondering if there was a way to call the name of the current sheet as
a variable in an equation, in such that I could write an equation like this:

= '('currentsheet' - 1)'!F20 + D20 - E20

That way I could simply use the same equation in all 25 sheets following
sheet 1. Is there such a way?

Per Jessen

Calling name of Sheet as a Variable?
 
Hi

You can use the INDIRECT function.

In A1 of current sheet enter sheet name of previous sheet, and use a formula
like this:

=INDIRECT(A1 & "!F20")+D20-E20

Hopes this helps.
....
Per

"thekeytothedoor" skrev i
meddelelsen ...
I'm working on a home budget, and I've made 26 sheets (labeled 1-26,
aptly).
Each of the sheets calls the previous information from the other sheets,
and
if I change something (say add a cost of 100 dollars to one column), it
retroactively affects the other sheets. It took a long time for me to
physically go in and change the equations on each sheet to call the
previous
sheet - every time i have to make a change, i have to change 26 sheets.

Example:
= '1'!F20 + D20 - E20 on '2'
= '2'!F20 + D20 - E20 on '3'
etc...

I was wondering if there was a way to call the name of the current sheet
as
a variable in an equation, in such that I could write an equation like
this:

= '('currentsheet' - 1)'!F20 + D20 - E20

That way I could simply use the same equation in all 25 sheets following
sheet 1. Is there such a way?




All times are GMT +1. The time now is 12:27 AM.

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