ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   file name on worksheet (https://www.excelbanter.com/excel-programming/365717-file-name-worksheet.html)

johne

file name on worksheet
 
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

Bob Phillips

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





All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com