Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dawg House Inc
 
Posts: n/a
Default Function to Return another Worksheets Name

Is there a way I can, in the first worksheet of 40, type in a cell a function
that will return me the name of another worksheet? I know how to return the
CURRENT worksheet.

I thought I could use the Worksheets collection and the Name property, but I
am stunned and brain dead right now, and if that is a possibility, I can't
get it to work.

Any and all help is muchly appreciated.

--
Dawg House Inc.
"We live in it, therefore, we know it!"
  #2   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Dawg House Inc" wrote in message
...
Is there a way I can, in the first worksheet of 40, type in a cell a

function
that will return me the name of another worksheet? I know how to return

the
CURRENT worksheet.

I thought I could use the Worksheets collection and the Name property, but

I
am stunned and brain dead right now, and if that is a possibility, I can't
get it to work.

Any and all help is muchly appreciated.

--
Dawg House Inc.
"We live in it, therefore, we know it!"


I think this link will get you started:
http://www.cpearson.com/excel/sheetref.htm

/Fredrik


  #3   Report Post  
Dawg House Inc
 
Posts: n/a
Default

I had already been to that site, thanks. That's where I got the current
worksheet piece. I am just looking to have a refence in a "Table Of Contents"
worksheet that will grab the names of the Worksheets in my workbook. I
realize I'd have to modify each cell, but I can't figure a way of doing it
yet. Stil hunting though....

JCH

"Fredrik Wahlgren" wrote:


"Dawg House Inc" wrote in message
...
Is there a way I can, in the first worksheet of 40, type in a cell a

function
that will return me the name of another worksheet? I know how to return

the
CURRENT worksheet.

I thought I could use the Worksheets collection and the Name property, but

I
am stunned and brain dead right now, and if that is a possibility, I can't
get it to work.

Any and all help is muchly appreciated.

--
Dawg House Inc.
"We live in it, therefore, we know it!"


I think this link will get you started:
http://www.cpearson.com/excel/sheetref.htm

/Fredrik



  #4   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Dawg House Inc" wrote in message
...
Is there a way I can, in the first worksheet of 40, type in a cell a

function
that will return me the name of another worksheet? I know how to return

the
CURRENT worksheet.

I thought I could use the Worksheets collection and the Name property, but

I
am stunned and brain dead right now, and if that is a possibility, I can't
get it to work.

Any and all help is muchly appreciated.

--
Dawg House Inc.
"We live in it, therefore, we know it!"


I'm not sure I understand what you want. Let's say you have n worksheets. Do
you want a function that takes a paramter, like position, and returns the
name of the n:th worksheet?

/Fredrik



  #5   Report Post  
Dawg House Inc
 
Posts: n/a
Default

Sorry for the confusion:

I want a cell to reference a particular worksheets Name property. I then
want the cell below it to reference the Next worksheet's Name property. So,
if I have 40 sheets, I'll have 40 cells that have some sort of function in
them that would refer to the worksheets' Names in my Active Workbook.

For example: Sheet 2 - Testing; Sheet 3 - Development; Sheet 4 - Quality
Assurance

Then, on sheet 1 - Table of Contents, I would like to have cells A2:A4
show as follows:
Testing
Development
Quality Assurance


Does that clear it up? My apologies again....

JCH


"Fredrik Wahlgren" wrote:


"Dawg House Inc" wrote in message
...
Is there a way I can, in the first worksheet of 40, type in a cell a

function
that will return me the name of another worksheet? I know how to return

the
CURRENT worksheet.

I thought I could use the Worksheets collection and the Name property, but

I
am stunned and brain dead right now, and if that is a possibility, I can't
get it to work.

Any and all help is muchly appreciated.

--
Dawg House Inc.
"We live in it, therefore, we know it!"


I'm not sure I understand what you want. Let's say you have n worksheets. Do
you want a function that takes a paramter, like position, and returns the
name of the n:th worksheet?

/Fredrik






  #6   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Dawg House Inc" wrote in message
...
Sorry for the confusion:

I want a cell to reference a particular worksheets Name property. I then
want the cell below it to reference the Next worksheet's Name property.

So,
if I have 40 sheets, I'll have 40 cells that have some sort of function in
them that would refer to the worksheets' Names in my Active Workbook.

For example: Sheet 2 - Testing; Sheet 3 - Development; Sheet 4 - Quality
Assurance

Then, on sheet 1 - Table of Contents, I would like to have cells A2:A4
show as follows:
Testing
Development
Quality Assurance


Does that clear it up? My apologies again....

JCH


I think so. Start the visual Basic Editor, insert a module and paste this

Public Function GetWsName() As String
Dim row As Long

row = Application.Caller.row

If row Application.Worksheets.Count Then
GetWsName= "Out of Range"
Else
GetWsName= Application.Worksheets(row).Name
End If
End Function

If you enter =GetWsName() in A1, it will return the name of the first
worksheet
If you enter =GetWsName() in A2, it will return the name of the second
worksheet
and so on

/Fredrik


  #7   Report Post  
Max
 
Posts: n/a
Default

Sounds like you're building a Table of Contents?

Think Jim Cone has an add-in (XLExtras Release 117) - available upon direct
request to him - which provides excellent capabilities to easily insert /
create a Table Of Contents (including navigating to chartsheets) amongst its
many features ..

For details, try one of Jim's posts at: http://tinyurl.com/67sx2
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Dawg House Inc" wrote in message
...
I had already been to that site, thanks. That's where I got the current
worksheet piece. I am just looking to have a refence in a "Table Of

Contents"
worksheet that will grab the names of the Worksheets in my workbook. I
realize I'd have to modify each cell, but I can't figure a way of doing it
yet. Stil hunting though....

JCH



  #8   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

Public Function TabByIndex(TabIndex As Integer) As String
' Next statement is optional
'Application.Volatile
TabByIndex = Sheets(TabIndex).Name
End Function

On worksheet, enter p.e.into cell A1 the formula
=TABBYINDEX(ROW())
and copy it down. (Probably you have to wrap the formula into error check
routine too). The list of all workscheets in their actual order is
displayed.


Arvi Laanemets


"Dawg House Inc" wrote in message
...
Is there a way I can, in the first worksheet of 40, type in a cell a

function
that will return me the name of another worksheet? I know how to return

the
CURRENT worksheet.

I thought I could use the Worksheets collection and the Name property, but

I
am stunned and brain dead right now, and if that is a possibility, I can't
get it to work.

Any and all help is muchly appreciated.

--
Dawg House Inc.
"We live in it, therefore, we know it!"



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
Return value with using Excel function SNOWBALLCHAN New Users to Excel 1 February 21st 05 07:25 AM
Function to look at two cells and return a third jlmam Excel Worksheet Functions 2 January 26th 05 04:41 PM
Find a Function to use accross different worksheets R. Hale Excel Worksheet Functions 3 November 25th 04 07:07 AM
search multiple worksheets for an item and return the Wsheets name Chris Excel Worksheet Functions 16 November 7th 04 12:15 PM
Function to return colour of formatted cell ExcelMonkey Excel Worksheet Functions 3 November 1st 04 05:54 PM


All times are GMT +1. The time now is 09:36 PM.

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

About Us

"It's about Microsoft Excel"