Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is there a function or a way to get automatically the title of a sheet? E.g if you have a sheet named Sales, have a text that shows Sales, which gets automatically updated as you change the sheet's title?
you can use GetActiveSheetId() function, and Default Sheet id are Sh001, Sh002 and so on,
but you can change them to Sales, Purchase, and so, and the use GetActiveSheetId() in text object, you will get it...
You can use a Macro to get the sheet name, but I try to avoid macros.
You can create a variable for every sheet name, then use the variable in all the expressions needed (as well as in the sheet properties itself).
Thanks, I thought of the variable but I wanted to see if there is something simple like a function.
you can use GetActiveSheetId() function, and Default Sheet id are Sh001, Sh002 and so on,
but you can change them to Sales, Purchase, and so, and the use GetActiveSheetId() in text object, you will get it...
There is a function to get the sheet ID:
GetActiveSheetID()
If you just want a simple string, no dynamic expression in your sheet title, you can try using the name as ID, then call GetActiveSheetID().
Thanks, nice one. But I get something like Document\Sales instead of Sales. Any idea? I could call another function like ignore the first nine characters though...if there is such.
Try
=subfield(GetActiveSheetID(),'\',2)
Alternatively, you can create a variable (vSheetName) and set an action at sheet opening in Sheet Properties to populate the variable with a name.
Obviously, this would have to be done for each sheet but it would give you whatever name you chose.
Regards,
Neil.
Thanks! It works fine. You can actually fill in only the Sheet ID and get the Sheet's title and the text or any other field updated by the function
Hi,
I have this issue in the Past.
The only way that I could do that, was using a simple inline with the Sheet name and ID, and then Using na expression. to get the name, as in:
= FieldValue('SheetName', FieldIndex ( 'SheetID', GetActiveSheetID() ))
Do not know if is the best solution, but it Works:
Please check attached.
Regards