Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Inserting a worksheet tab name into a cell

I have a workbook with several worksheet tabs that have individual names on
them. I need to take the name and put it going down a column inside the
worksheet of that name for varying number of rows and I need to do this for
each worksheet.

Example:

Workbook A has sheets named
Lynn Bales, Joe Brown, Daphne Anderson

In worksheet Lynn Bales, I want the text "Lynn Bales" to go into column D to
the end of the rowed data. Then I want to do the same for Joe Brown's
worksheet and Daphne Anderson's worksheet.

Is this feasible? Thank you in advance!

Lynn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Inserting a worksheet tab name into a cell

In a standard code module (the same kind you get when you record a macro) you
can add the following function.

Public Function TabName() As String
Application.Volatile
TabName = Application.Caller.Worksheet.Name
End Function

This function can be used in a cell in a spreadsheet. For example on the
Lynn Bales sheet in the cells of column D add =TabName()

If the name of the sheet changes then this formula will automatically update
the next the the sheet is calculated.
--
HTH...

Jim Thomlinson


"Lynn Bales" wrote:

I have a workbook with several worksheet tabs that have individual names on
them. I need to take the name and put it going down a column inside the
worksheet of that name for varying number of rows and I need to do this for
each worksheet.

Example:

Workbook A has sheets named
Lynn Bales, Joe Brown, Daphne Anderson

In worksheet Lynn Bales, I want the text "Lynn Bales" to go into column D to
the end of the rowed data. Then I want to do the same for Joe Brown's
worksheet and Daphne Anderson's worksheet.

Is this feasible? Thank you in advance!

Lynn

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting comment in unlocked cell of protected Excel worksheet? Mike Ives Excel Worksheet Functions 1 January 30th 09 12:06 AM
Inserting a new Worksheet cRooKsy09 Excel Discussion (Misc queries) 3 June 6th 07 07:55 PM
Inserting New Worksheet Problems with formula within worksheet Excel Discussion (Misc queries) 0 November 30th 06 04:38 PM
Inserting row in 1 worksheet and updating a different row in another worksheet [email protected] Excel Discussion (Misc queries) 0 August 9th 06 09:13 PM
Inserting new worksheet tanyhart[_13_] Excel Programming 1 June 8th 06 02:54 PM


All times are GMT +1. The time now is 04:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"