Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Want Cell A1 equal to File name + Worksheet name

Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Want Cell A1 equal to File name + Worksheet name

If you are looking for a macro try this. Launch VBE using Alt + F11. From the
left tree view double click 'This Workbook' and paste the below code. Get
back to workbook. The below code will write the bookname and sheet name to
cell A1 on Save....

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Range("A1") = "[" & ThisWorkbook.Name & "]" & ThisWorkbook.ActiveSheet.Name
End Sub

--
If this post helps click Yes
---------------
Jacob Skaria


"Lawrence" wrote:

Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default Want Cell A1 equal to File name + Worksheet name

=CELL("filename",A1)


On 21 Maj, 08:31, Lawrence wrote:
Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Want Cell A1 equal to File name + Worksheet name

Using a formula, you can try this provided the workbook is already saved.

=SUBSTITUTE(CELL("filename"),INFO("directory"),)

If this post helps click Yes
---------------
Jacob Skaria


"Lawrence" wrote:

Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Want Cell A1 equal to File name + Worksheet name

Try this formula in A1:
=CELL("filename",A1)
Regards,
Stefi

€˛Lawrence€¯ ezt Ć*rta:

Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default Want Cell A1 equal to File name + Worksheet name

Thanks .. it works perfectly..

but just need to do some text function to make it nicer.



"Stefi" wrote:

Try this formula in A1:
=CELL("filename",A1)
Regards,
Stefi

€˛Lawrence€¯ ezt Ć*rta:

Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Want Cell A1 equal to File name + Worksheet name

You are welcome! Thanks for the feedback!
Clicking the YES button will be appreciated.
Post if you can tell us what form would be nicer for xou!
Stefi

€˛Lawrence€¯ ezt Ć*rta:

Thanks .. it works perfectly..

but just need to do some text function to make it nicer.



"Stefi" wrote:

Try this formula in A1:
=CELL("filename",A1)
Regards,
Stefi

€˛Lawrence€¯ ezt Ć*rta:

Hi,

i want the cell A1 equal to File name + Worksheet name.. is it possible?

Lawrence

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Want Cell A1 equal to File name + Worksheet name


This will give you File Name :

=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1,
SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

This will give you sheet name :

=REPLACE(CELL("Filename",A1),1,FIND("]",CELL("filename",A1)),"")


--
mubashir aziz

If this post helps Don't 4get to click Yes
------------------------------------------------------------------------
mubashir aziz's Profile: http://www.thecodecage.com/forumz/member.php?userid=237
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=98725

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
File name equal cell contents Petester Excel Discussion (Misc queries) 7 June 17th 08 06:46 PM
Cell equal to File Name Pedro Serra Excel Discussion (Misc queries) 4 July 24th 06 04:06 PM
How do you set the worksheet name equal to file name? cooldad816 Excel Discussion (Misc queries) 1 July 21st 06 12:12 AM
File name equal cell contents cxlough41 Excel Discussion (Misc queries) 0 January 3rd 06 10:47 PM
File name equal cell contents ynissel Excel Discussion (Misc queries) 0 May 25th 05 03:41 PM


All times are GMT +1. The time now is 05:45 PM.

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

About Us

"It's about Microsoft Excel"