Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Can a cell value be set equal to a spreadsheet name

I am attempting to set a cell in a spreadsheet equal to a title of another
worksheet. Is this possible to do?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,365
Default Can a cell value be set equal to a spreadsheet name

Yes and no? This is almost one of those "you have to know the answer before
we will tell you the answer" type of things.
A formula that will give you the sheet name of a sheet in the workbook is
this one (entered into a cell on 'Sheet1' and pointed to a cell in another
sheet in the workbook [Sheet3])

=MID(CELL("address",Sheet3!A1),FIND("]",CELL("address",Sheet3!A1))+1,FIND("!",CELL("addr ess",Sheet3!A1))-FIND("]",CELL("address",Sheet3!A1))-1)

If you'll put this formula into another cell on Sheet1 you will see the need
for the FIND() functions in it:
=CELL("address",Sheet3!A1)

So you have to know the name of the other sheet before you can ask for the
name of that other sheet. But if the name of the other sheet is changed
later, the formula will show the new name.

Another way to do this is using VB code to work through the list of sheets
in the workbook and put their names into cells in a particular workbook:

Sub ListSheetNames()
Dim anySheet As Worksheet

Worksheets("Sheet1").Select
Range("A1").Select
For Each anySheet In Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub



"amp4cats" wrote:

I am attempting to set a cell in a spreadsheet equal to a title of another
worksheet. Is this possible to do?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Can a cell value be set equal to a spreadsheet name

Thank you, it work like a charm.
Exactly what I needed.

"JLatham" wrote:

Yes and no? This is almost one of those "you have to know the answer before
we will tell you the answer" type of things.
A formula that will give you the sheet name of a sheet in the workbook is
this one (entered into a cell on 'Sheet1' and pointed to a cell in another
sheet in the workbook [Sheet3])

=MID(CELL("address",Sheet3!A1),FIND("]",CELL("address",Sheet3!A1))+1,FIND("!",CELL("addr ess",Sheet3!A1))-FIND("]",CELL("address",Sheet3!A1))-1)

If you'll put this formula into another cell on Sheet1 you will see the need
for the FIND() functions in it:
=CELL("address",Sheet3!A1)

So you have to know the name of the other sheet before you can ask for the
name of that other sheet. But if the name of the other sheet is changed
later, the formula will show the new name.

Another way to do this is using VB code to work through the list of sheets
in the workbook and put their names into cells in a particular workbook:

Sub ListSheetNames()
Dim anySheet As Worksheet

Worksheets("Sheet1").Select
Range("A1").Select
For Each anySheet In Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub



"amp4cats" wrote:

I am attempting to set a cell in a spreadsheet equal to a title of another
worksheet. Is this possible to do?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Can a cell value be set equal to a spreadsheet name

When attempting your solution, I received a #VALUE! error

"JLatham" wrote:

Yes and no? This is almost one of those "you have to know the answer before
we will tell you the answer" type of things.
A formula that will give you the sheet name of a sheet in the workbook is
this one (entered into a cell on 'Sheet1' and pointed to a cell in another
sheet in the workbook [Sheet3])

=MID(CELL("address",Sheet3!A1),FIND("]",CELL("address",Sheet3!A1))+1,FIND("!",CELL("addr ess",Sheet3!A1))-FIND("]",CELL("address",Sheet3!A1))-1)

If you'll put this formula into another cell on Sheet1 you will see the need
for the FIND() functions in it:
=CELL("address",Sheet3!A1)

So you have to know the name of the other sheet before you can ask for the
name of that other sheet. But if the name of the other sheet is changed
later, the formula will show the new name.

Another way to do this is using VB code to work through the list of sheets
in the workbook and put their names into cells in a particular workbook:

Sub ListSheetNames()
Dim anySheet As Worksheet

Worksheets("Sheet1").Select
Range("A1").Select
For Each anySheet In Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub



"amp4cats" wrote:

I am attempting to set a cell in a spreadsheet equal to a title of another
worksheet. Is this possible to do?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,365
Default Can a cell value be set equal to a spreadsheet name

I'm a bit confused - you said it worked, then it didn't work? Or were you
responding to David's post when you said it didn't work?
Which worked? Which failed?


"amp4cats" wrote:

When attempting your solution, I received a #VALUE! error

"JLatham" wrote:

Yes and no? This is almost one of those "you have to know the answer before
we will tell you the answer" type of things.
A formula that will give you the sheet name of a sheet in the workbook is
this one (entered into a cell on 'Sheet1' and pointed to a cell in another
sheet in the workbook [Sheet3])

=MID(CELL("address",Sheet3!A1),FIND("]",CELL("address",Sheet3!A1))+1,FIND("!",CELL("addr ess",Sheet3!A1))-FIND("]",CELL("address",Sheet3!A1))-1)

If you'll put this formula into another cell on Sheet1 you will see the need
for the FIND() functions in it:
=CELL("address",Sheet3!A1)

So you have to know the name of the other sheet before you can ask for the
name of that other sheet. But if the name of the other sheet is changed
later, the formula will show the new name.

Another way to do this is using VB code to work through the list of sheets
in the workbook and put their names into cells in a particular workbook:

Sub ListSheetNames()
Dim anySheet As Worksheet

Worksheets("Sheet1").Select
Range("A1").Select
For Each anySheet In Worksheets
ActiveCell = anySheet.Name
ActiveCell.Offset(1, 0).Activate
Next
End Sub



"amp4cats" wrote:

I am attempting to set a cell in a spreadsheet equal to a title of another
worksheet. Is this possible to do?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Can a cell value be set equal to a spreadsheet name

=MID(CELL("filename",Sheet2!A1), FIND("]", CELL("filename", Sheet2!A1))+ 1,
255)
will give "Sheet2" as a result.
--
David Biddulph

"amp4cats" wrote in message
...
I am attempting to set a cell in a spreadsheet equal to a title of another
worksheet. Is this possible to do?



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
can I make cell "yes" equal 1, "no" equal 0 can I make cell yes equal 1, no equa Excel Discussion (Misc queries) 4 April 22nd 23 06:09 AM
How to point to (select) a cell to the left from a cell where I enter the = equal sign? Dmitry Excel Discussion (Misc queries) 4 June 30th 06 06:49 AM
Setting a cell equal to another worksheet cell fails (sometimes) Richard Excel Worksheet Functions 2 March 10th 06 04:11 AM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM
Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 7th 04 10:50 PM


All times are GMT +1. The time now is 04:05 AM.

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"