Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Find and return name of worksheet tab for referenced cell

I have a spreadsheet with many differently named tabs.

On the first tab there are a list of names for client who work at different
offices.

I'd like to have a formula find that client's name on the following
worksheet tabs and then in a cell next to that name to tell me which tab the
record appears.

So for example:
On first tab: Michelle

The information for Michelle is on the Ohio tab

Can the formula go out and find Michelle's name on the Ohio tab and then put
the "Ohio tab name" in the cell next to her name?

Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Find and return name of worksheet tab for referenced cell

MMangen,

You can do it easily with a USer-Defined-Function. The code is below, copy it into a standard code
module in your workbook, and use it like

=Where(A1)

with Michelle in cell A1, it will return the first sheet name where Michelle is found, or "Not
Found" if Michelle appears on no other sheet than the first sheet.


HTH,
Bernie
MS Excel MVP


Function Where(myV As Variant) As String
Dim myS As Worksheet
Dim myP As String
Dim myR As Range

Where = "Not Found"

myP = Application.Caller.Parent.Name
For Each myS In Worksheets
If myS.Name < myP Then
Set myR = myS.Cells.Find(myV)
If Not myR Is Nothing Then
Where = myS.Name
Exit Function
End If
End If
Next myS
End Function


"MMangen" wrote in message
...
I have a spreadsheet with many differently named tabs.

On the first tab there are a list of names for client who work at different
offices.

I'd like to have a formula find that client's name on the following
worksheet tabs and then in a cell next to that name to tell me which tab the
record appears.

So for example:
On first tab: Michelle

The information for Michelle is on the Ohio tab

Can the formula go out and find Michelle's name on the Ohio tab and then put
the "Ohio tab name" in the cell next to her name?

Thanks!




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Find and return name of worksheet tab for referenced cell

Bernie:

Thanks, will try this out and will let you know how it worked!

"Bernie Deitrick" wrote:

MMangen,

You can do it easily with a USer-Defined-Function. The code is below, copy it into a standard code
module in your workbook, and use it like

=Where(A1)

with Michelle in cell A1, it will return the first sheet name where Michelle is found, or "Not
Found" if Michelle appears on no other sheet than the first sheet.


HTH,
Bernie
MS Excel MVP


Function Where(myV As Variant) As String
Dim myS As Worksheet
Dim myP As String
Dim myR As Range

Where = "Not Found"

myP = Application.Caller.Parent.Name
For Each myS In Worksheets
If myS.Name < myP Then
Set myR = myS.Cells.Find(myV)
If Not myR Is Nothing Then
Where = myS.Name
Exit Function
End If
End If
Next myS
End Function


"MMangen" wrote in message
...
I have a spreadsheet with many differently named tabs.

On the first tab there are a list of names for client who work at different
offices.

I'd like to have a formula find that client's name on the following
worksheet tabs and then in a cell next to that name to tell me which tab the
record appears.

So for example:
On first tab: Michelle

The information for Michelle is on the Ohio tab

Can the formula go out and find Michelle's name on the Ohio tab and then put
the "Ohio tab name" in the cell next to her name?

Thanks!





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
has a cell been referenced in another worksheet reedspencer Excel Discussion (Misc queries) 3 October 2nd 07 04:06 PM
Find where else in a spreadsheet a cell is referenced with formula Analyser Excel Worksheet Functions 1 June 27th 07 02:52 PM
function CELL() to return the formula in the referenced cell Streep Excel Worksheet Functions 3 August 20th 05 10:24 PM
How can I return a cross referenced cell value? JR Excel Worksheet Functions 5 August 15th 05 11:37 PM
Excel should find all places a particular cell is referenced julesme1 Excel Worksheet Functions 2 March 7th 05 05:11 PM


All times are GMT +1. The time now is 11:28 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"