Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
File name into a variable
In an excel macro, how can I place the name of the file I
am working on into a variable? Thanks for your help in advance, Tim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
File name into a variable
The code gives the name of the VB file, not the excel
file. Is there a way to give the name of the excel file? -----Original Message----- Hi, Supposing the variable is called 's', you would do: Dim s As String s = ThisWorkbook.name Regards, Alex "Tim" wrote: In an excel macro, how can I place the name of the file I am working on into a variable? Thanks for your help in advance, Tim . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
File name into a variable
The code gives the name of the VB file, not the excel
file. Is there a way to give the name of the excel file? ??????? Public Sub myFile() Dim s As String s = ThisWorkbook.Name MsgBox (s) End Sub -- ---------------------------- Mauro Gamberini |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
File name into a variable
No it does not. It gives the name of the excel file. "ThisWorkbook" means "this excel file". Please try out the code before replying, as you mislead other users.
" wrote: The code gives the name of the VB file, not the excel file. Is there a way to give the name of the excel file? -----Original Message----- Hi, Supposing the variable is called 's', you would do: Dim s As String s = ThisWorkbook.name Regards, Alex "Tim" wrote: In an excel macro, how can I place the name of the file I am working on into a variable? Thanks for your help in advance, Tim . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Variable File Name | Excel Discussion (Misc queries) | |||
calling a value from another file using a variable in the file nam | Excel Worksheet Functions | |||
calling a value from another file using a variable in the file nam | Excel Discussion (Misc queries) | |||
Variable File Name | Excel Worksheet Functions | |||
Variable File Name | Excel Programming |