Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
macro to grab current workbook filename
Excel 2003:
I need a macro that grabs the current workbook filename and drops it into cell A2. I know this is simple, but my head is fried this evening.... |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
macro to grab current workbook filename
TR,
We need a better description of "cell A2"- what sheet?, what workbook?, etc, but something like this might get you started: Sub TRYoung() ThisWorkbook.Sheets("Sheetname").Range("A2").Value = Activeworkbook.FullName End Sub HTH, Bernie MS Excel MVP "TR Young" wrote in message ... Excel 2003: I need a macro that grabs the current workbook filename and drops it into cell A2. I know this is simple, but my head is fried this evening.... |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
macro to grab current workbook filename
Do you want a macro?
You don't "need" one. Simple worksheet function can return filename to a cell. See Bob Phillips' site for various permutations. http://www.xldynamic.com/source/xld.xlFAQ0002.html Gord Dibben MS Excel MVP On Thu, 11 Jun 2009 16:18:32 -0400, "TR Young" wrote: Excel 2003: I need a macro that grabs the current workbook filename and drops it into cell A2. I know this is simple, but my head is fried this evening.... |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
macro to grab current workbook filename
Hi,
In cell A2 enter =MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("filename",A1),1)-FIND("[",CELL("filename",A1),1)-1) If this helps please click yes, thanks "TR Young" wrote: Excel 2003: I need a macro that grabs the current workbook filename and drops it into cell A2. I know this is simple, but my head is fried this evening.... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Function to insert current filename into worksheet? | Excel Worksheet Functions | |||
Enter current date automatically in filename | Excel Worksheet Functions | |||
save workbook as current date using a macro | Excel Discussion (Misc queries) | |||
Create buttom that saves current file in a given filename (Excel) | Excel Worksheet Functions | |||
I want a cell to show the current filename automatically. | Excel Discussion (Misc queries) |