K
karl gauss
Is there a "sheet" function or something like it which returns the
current sheet number?
current sheet number?
You can get the current worksheet name by
=MID(CELL("filename",A1),1+FIND("]",CELL("filename",A1)),255)
This only works if the file has first been saved, otherwise it returns
#VALUE!
You might want to substitute for A1 the cell reference of the calling
formula, to protect against row or column deletion having an effect.
To get the worksheet index number is not quite so simple, I think. Perhaps
one way is to include the worksheet index number within the worksheet name,
at a determined position within the name string, and then use MID() on the
above to get the sheet number.
Another way, rather unstable is:
Define a named formula
AllSheets
refers to
=GET.WORKBOOK(1+0*NOW())
and define another named formula
ThisSheet
refers to
=GET.CELL(32+0*NOW(),INDIRECT("rc",FALSE))
Then
=MATCH(ThisSheet,AllSheets,0)
should return the index number of the worksheet.
Don't try copying the formula to another sheet using an early version of
Excel, or it will hang.
--
Return email address is not as DEEP as it appears
karl gauss said:Is there a "sheet" function or something like it which returns the
current sheet number?
karl gauss said:Wow, I can't manage this.
I'm trying to migrate from Quattro Pro to Excel.
Here is what I'm trying to do, and here is how easily I do it in
Quattro Pro:
I have a sequence of numbers in a column in the first sheet.
On the second sheet, I wish to call the first number from the first
sheet.
On the third sheet, I wish to call the second number from the first
sheet.
On the fourth sheet, I wish to call the third number from the first
sheet.
And so on.
This command posted on each sheet from the second on down does it in
Quattro Pro:
@INDEX($A:$A$5..$A:$A$37,0,@CELL("Sheet",A2..A2)-2)
where after @index are block, column-1 and row. The row is gained
merely by recognizing a simple bijection between row of entry on the
first sheet and the sheet numbers themselves. This is built into the
@CELL command parameters.
I can see from reading the help file in Excel all I need regarding the
INDEX and CELL commands except how to gain the sheet number. Notice
that in Quattro Pro, all that is needed is "sheet".
That last bit is what troubles me - how to gain the sheet number in
Excel.
Maybe I'm overlooking something really trivial.
Any ideas from you experts pls?
Thx!!
You can get the current worksheet name by
=MID(CELL("filename",A1),1+FIND("]",CELL("filename",A1)),255)
This only works if the file has first been saved, otherwise it returns
#VALUE!
You might want to substitute for A1 the cell reference of the calling
formula, to protect against row or column deletion having an effect.
To get the worksheet index number is not quite so simple, I think.
Perhaps
one way is to include the worksheet index number within the worksheet
name,
at a determined position within the name string, and then use MID() on the
above to get the sheet number.
Another way, rather unstable is:
Define a named formula
AllSheets
refers to
=GET.WORKBOOK(1+0*NOW())
and define another named formula
ThisSheet
refers to
=GET.CELL(32+0*NOW(),INDIRECT("rc",FALSE))
Then
=MATCH(ThisSheet,AllSheets,0)
should return the index number of the worksheet.
Don't try copying the formula to another sheet using an early version of
Excel, or it will hang.
--
Return email address is not as DEEP as it appears
karl gauss said:Is there a "sheet" function or something like it which returns the
current sheet number?
....karl gauss said:I'm trying to migrate from Quattro Pro to Excel.
I have a sequence of numbers in a column in the first sheet.
On the second sheet, I wish to call the first number from the first
sheet.
On the third sheet, I wish to call the second number from the first
sheet.
On the fourth sheet, I wish to call the third number from the first
sheet.
And so on.