Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default populating cells with sheet names

Hi from a newb... I'm creating a file with numerous sheets and want to
automatically populate a cell with the sheet name. That way, if a
sheet name changes (which it does often) the cell in question will
populate with the new sheet name without any intervention from the
user.

TIA for your help!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default populating cells with sheet names

See

http://www.mcgimpsey.com/excel/cell_function.html

In article .com,
"bjrbrain" wrote:

Hi from a newb... I'm creating a file with numerous sheets and want to
automatically populate a cell with the sheet name. That way, if a
sheet name changes (which it does often) the cell in question will
populate with the new sheet name without any intervention from the
user.

TIA for your help!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default populating cells with sheet names

Better to do it with formulas. Go to the bottom of this page on Chip
Pearson's site:

http://www.cpearson.com/excel/excelF.htm

This doesn't work if the worksheet hasn't been saved at least once, but that
shouldn't be a problem in the situation you describe.

--
Regards,
Tom Ogilvy


"bjrbrain" wrote in message
oups.com...
Hi from a newb... I'm creating a file with numerous sheets and want to
automatically populate a cell with the sheet name. That way, if a
sheet name changes (which it does often) the cell in question will
populate with the new sheet name without any intervention from the
user.

TIA for your help!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default populating cells with sheet names

If A1 is where you want to record the sheet name,

Range("A1").Value = Activesheet.name
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default populating cells with sheet names

Thanks for the suggestion but it doesn't seem to work for me. Keying
this into the cell with an '=' sign just produces a #NAME?

I will say that your solution is much more user friendly than another
one that was suggested:(for when someone else takes over my
spreadsheets):

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,
LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))

What, pray tell, am I doing wrong in regards to your suggestion?

Thanks again,
Brian



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default populating cells with sheet names

Hard to tell - your formula works for me, though this is a bit more
efficient:

=MID(CELL("filename",A1), FIND("]", CELL("filename", A1))+ 1, 255)

I can generate a #NAME! error if I switch the sheet to use R1C1-style
references. In that case the formula should be something like:

=MID(CELL("filename",RC), FIND("]", CELL("filename", RC))+ 1, 255)


In article .com,
"bjrbrain" wrote:

Thanks for the suggestion but it doesn't seem to work for me. Keying
this into the cell with an '=' sign just produces a #NAME?

I will say that your solution is much more user friendly than another
one that was suggested:(for when someone else takes over my
spreadsheets):

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,
LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))

What, pray tell, am I doing wrong in regards to your suggestion?

Thanks again,
Brian

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
Populating listbox with sheet names johnb Excel Discussion (Misc queries) 1 May 16th 08 12:33 PM
Populating ComboBox with Folder Names Tyrell Excel Programming 1 March 8th 06 04:25 PM
Populating a select group of cells with randomized names... Kevin Lyons Excel Programming 1 February 10th 05 01:15 PM
VBA for opening file/populating combo box with sheet names Sinobato[_4_] Excel Programming 3 July 26th 04 06:35 PM
Populating sheet names in combobox Todd Huttenstine[_2_] Excel Programming 3 December 21st 03 12:11 AM


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