Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In excel vba I want to add a line that displays the name of the workbook on a
summary sheet Is there an automatic way to add the name without typing it in here's what I have so far: 'Enter Name ..Range ("B1") = "NAME" Thank you in advance !!! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
The first line puts the name in a cell the second one puts the full path and name Sheets("Sheet1").Range("A1") = ThisWorkbook.Name Sheets("Sheet1").Range("A2") = ThisWorkbook.FullName -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "confused" wrote: In excel vba I want to add a line that displays the name of the workbook on a summary sheet Is there an automatic way to add the name without typing it in here's what I have so far: 'Enter Name .Range ("B1") = "NAME" Thank you in advance !!! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=CELL("Filename")
-- Hope this helps. If it does, please click the Yes button. Thanks in advance for your feedback. Gary Brown "confused" wrote: In excel vba I want to add a line that displays the name of the workbook on a summary sheet Is there an automatic way to add the name without typing it in here's what I have so far: 'Enter Name .Range ("B1") = "NAME" Thank you in advance !!! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=CELL("Filename")
Be careful with that. If another workbook is active when Excel calculates the formula, that will return the name of the active workbook, not the name of the workbook containing the formula. You can force it to use the workbook containing the formula with =CELL("filename",A1) It doesn't matter what cell you pass to CELL; just pass any cell that is in the workbook whose name you want to retrieve.\ Cordially, Chip Pearson Microsoft MVP 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com [email on web site] On Fri, 12 Mar 2010 13:00:01 -0800, Gary Brown wrote: =CELL("Filename") |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|