Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2013, 03:23 PM
derohanes derohanes is offline getting the worksheet name in a cell Windows Vista getting the worksheet name in a cell Office 2007
Advanced Beginner
getting the worksheet name in a cell
 
Join Date: Oct 2008
Posts: 67
derohanes is on a distinguished road
Default getting the worksheet name in a cell


Is there a command that retrieves the worksheet name and puts it into a cell.
Reply With Quote
  #2  
Old 02-13-2013, 11:16 PM
Catalin.B Catalin.B is offline getting the worksheet name in a cell Windows Vista getting the worksheet name in a cell Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

To do that, there is a way: Define a name, like SheetName, and place in the "Refers to:" field, this formula:
=GET.CELL(62;Sheet2!$G$26) (if you want another sheet, change the reference in red)
Then, in any cell in any sheet, you will get the sheet2 name with:
=RIGHT(SheetName;LEN(SheetName)-FIND("]";SheetName))
You can simply use:
=SheetName
but you will get the sheet name precedeed by the workbook name...
For a list of information that can be obtained from Get.Cell function, (the function is available only in defined names, or in VB), you can check this:
http://www.mrexcel.com/forum/excel-q...arguments.html

Or, another way, is to use Cell function, available in sheet functions:
=RIGHT(CELL("filename";J16);LEN(CELL("filename";J1 6))-FIND("]";CELL("filename";J16)))
The =CELL("filename";J16) formula extracts the full path of the reference...
Reply With Quote
  #3  
Old 02-13-2013, 11:51 PM
macropod's Avatar
macropod macropod is offline getting the worksheet name in a cell Windows 7 64bit getting the worksheet name in a cell Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Just in case you're wondering, the 'J16' in Catalin's formula is of no consequence. The following are equally valid:
=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1) )-FIND("]",CELL("filename",A1)))
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,LEN(CELL("filename",A 1))- FIND("]",CELL("filename",A1)))

Note: the ';' in Catalin's formula assumes a non-English Windows regional setting. The ',' in mine assumes an English Windows regional setting.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 02-14-2013, 12:01 AM
Catalin.B Catalin.B is offline getting the worksheet name in a cell Windows Vista getting the worksheet name in a cell Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

Absolutely right Paul, with just a minor correction: there are english regional settings with ';' as list separator...
Reply With Quote
  #5  
Old 02-14-2013, 12:05 AM
macropod's Avatar
macropod macropod is offline getting the worksheet name in a cell Windows 7 64bit getting the worksheet name in a cell Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Catalin.B View Post
Absolutely right Paul, with just a minor correction: there are non-english regional settings with ';' as list separator, like French and many others...
And these are related to your Windows regional settings, n'est pas?

PS: The formula solutions only work with a saved workbook.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 02-14-2013, 12:21 AM
Catalin.B Catalin.B is offline getting the worksheet name in a cell Windows Vista getting the worksheet name in a cell Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

My mistake, i meant:
"there are english regional settings with ';' as list separator..."
By the way, i'm not a fluent french speaker :d
Reply With Quote
  #7  
Old 02-14-2013, 07:51 AM
derohanes derohanes is offline getting the worksheet name in a cell Windows Vista getting the worksheet name in a cell Office 2007
Advanced Beginner
getting the worksheet name in a cell
 
Join Date: Oct 2008
Posts: 67
derohanes is on a distinguished road
Default

Thanks all. Where is a list of the reference fields for the info_type "filename"?
Reply With Quote
  #8  
Old 02-14-2013, 08:25 AM
Catalin.B Catalin.B is offline getting the worksheet name in a cell Windows Vista getting the worksheet name in a cell Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

When you start typing: =Cell and double click on CELL from the list of functions, this is what you see:
Attached Images
File Type: jpg cell.jpg (12.1 KB, 10 views)
Reply With Quote
  #9  
Old 02-14-2013, 09:26 AM
derohanes derohanes is offline getting the worksheet name in a cell Windows Vista getting the worksheet name in a cell Office 2007
Advanced Beginner
getting the worksheet name in a cell
 
Join Date: Oct 2008
Posts: 67
derohanes is on a distinguished road
Default

Thanks Caitlin, but those are the info_types. I was asking for the references for the info_type "filename". In this case, A1
Reply With Quote
  #10  
Old 02-14-2013, 01:29 PM
macropod's Avatar
macropod macropod is offline getting the worksheet name in a cell Windows 7 64bit getting the worksheet name in a cell Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As I said in my first post on this topic, with "filename" the cell reference (A1) is of no consequence. You could use any valid cell address and the result would be the same. That's because every cell on a worsheet belongs to the same worksheet ...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
getting the worksheet name in a cell How to summarise different worksheet to a summary worksheet samkiewhock Excel 1 09-06-2012 03:34 AM
getting the worksheet name in a cell Cell formating on Protected worksheet AHB Excel Programming 2 02-27-2012 10:25 AM
getting the worksheet name in a cell "Auto-populating" data-worksheet to worksheet. meggenm Excel 4 02-04-2012 02:04 AM
Auto-populate an MS Word table cell with text from a diff cell? dreamrthts Word Tables 0 03-20-2009 01:49 PM
click a cell to go to a worksheet victor Excel 0 10-27-2006 02:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft