View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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

.