Tab Names
Hi,
Is it possible to have Excel populate a cell (for example A1) with the name of that worksheet tab? This could then be used across the rest of the book. Many thanks |
Tab Names
See http://www.xldynamic.com/source/xld.xlFAQ0002.html
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Andy the Yeti" wrote in message ... Hi, Is it possible to have Excel populate a cell (for example A1) with the name of that worksheet tab? This could then be used across the rest of the book. Many thanks |
Tab Names
Hi Andy,
There may be a much easier way todo this, but you can paste the below into a module: Public Function tab_name() tab_name = ActiveSheet.Name End Function then in A1 enter = tab_name() This will return the tab name into call A1 but if you make a change to the tabs name, you will have to re-enter the formula as it won't autocalc. Thanks, Simon Andy the Yeti wrote: Hi, Is it possible to have Excel populate a cell (for example A1) with the name of that worksheet tab? This could then be used across the rest of the book. Many thanks -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200610/1 |
Tab Names
Thank guys both great!
"smw226 via OfficeKB.com" wrote: Hi Andy, There may be a much easier way todo this, but you can paste the below into a module: Public Function tab_name() tab_name = ActiveSheet.Name End Function then in A1 enter = tab_name() This will return the tab name into call A1 but if you make a change to the tabs name, you will have to re-enter the formula as it won't autocalc. Thanks, Simon Andy the Yeti wrote: Hi, Is it possible to have Excel populate a cell (for example A1) with the name of that worksheet tab? This could then be used across the rest of the book. Many thanks -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200610/1 |
Tab Names
I think I'd use:
Option Explicit Public Function tab_name() tab_name = Application.Caller.Parent.Name End Function If I were using the UDF. Activesheet.name will be the name of the activesheet--not always the sheet containing the formula. "smw226 via OfficeKB.com" wrote: Hi Andy, There may be a much easier way todo this, but you can paste the below into a module: Public Function tab_name() tab_name = ActiveSheet.Name End Function then in A1 enter = tab_name() This will return the tab name into call A1 but if you make a change to the tabs name, you will have to re-enter the formula as it won't autocalc. Thanks, Simon Andy the Yeti wrote: Hi, Is it possible to have Excel populate a cell (for example A1) with the name of that worksheet tab? This could then be used across the rest of the book. Many thanks -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200610/1 -- Dave Peterson |
All times are GMT +1. The time now is 07:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com