Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Excel Function

  Asked By: Cathy    Date: Dec 31    Category: MS Office    Views: 763
  

Is it possible to get or make a Excel function to identify the active sheet
and to be used as the following example.

Example:
In a sheet named "RESULTS" in the cell A1 I write: if
(actsheet()="CityBank"; 1,23; 1,75)

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Beverly Brooks     Answered On: Dec 31

: Is it possible to get or make a Excel function  to identify  the
active  sheet and to be used as the following example.
:
: In a sheet  named "RESULTS" in the cell  A1 I write: if
: (actsheet()="CityBank"; 1,23; 1,75)

This works in my locale. You will probably need to change the
IF() function syntax to work with your number system.

In cell:
=IF(ActiveSheetName("CityBank"),1.23,1.75)

In module:
Function ActiveSheetName(Name As String)

ActiveSheetName = False
If Application.ActiveSheet.Name = Name Then ActiveSheetName = True

End Function

 
Answer #2    Answered By: Adelfrid Fischer     Answered On: Dec 31

I do a bit of this all the time because some of my "clients" like to alter
the names of worksheets. Being in a multi language environment has it's
ummmm drawbacks :-)

I reflect the name of the sheet  in cell  A1 so if the sheet is printed the
name is there as the user has altered it in nice big letters.

I don't think it's completely what you are looking for but maybe a pointer.

The formual I use is....

=TRIM(MID(CELL("filename",A1),(FIND("]",CELL("filename",A1))+1),50))

 
Answer #3    Answered By: Barabas Cohen     Answered On: Dec 31

I'm not sure I see the purpose of such a function? You'd also need
to have write  some workbook or worksheet based events to trigger a
recalculation of the workbook as the active  sheet changes, since
changing the active worksheet doesn't automatically cause a
recalculation.

But, this should get you the active sheet  name at the time of any
recalculation (but "filename" only has a value if you've previously
saved the workbook):

=MID(CELL("filename"),(FIND("]",CELL("filename"))+1),50)

If you just want to return the sheet name fo the worksheet the
function is located in, you'd use:

=MID(CELL("filename",A1),(FIND("]",CELL("filename",A1))+1),50)

 
Didn't find what you were looking for? Find more on Excel Function Or get search suggestion and latest updates.




Tagged: