View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default file name on worksheet

Range("A1").Value = Activeworkbook.Name

for just the file name

Range("A1").Value = Activeworkbook.Fullname

for the path and file name

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JohnE" wrote in message
...
Hello. It has been a while since working with vba in excel so I am rusty.

I
have created a pivot table using vba language but would like to add the

file
name in cell A1. I have been able to have a title written inside the vba
using the Activecell.formulaR1C1, but would prefer to put the file name in
there instead. The language is currently able to be used with any open
workbook.

Can anyone help in solving this as I am at a loss? Thanks to anyone
responding.

*** John