Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Worksheet to new file jai Excel Discussion (Misc queries) 2 August 24th 07 10:12 PM
copy part of a worksheet into a worksheet in the same file/keepi. JTB Excel Worksheet Functions 1 September 23rd 06 09:13 AM
Saving worksheet in new file with date AND cell value as file name michaelberrier Excel Discussion (Misc queries) 4 May 26th 06 08:05 PM
File opens as worksheet.xls:1 and worksheet.xls:2. Only one exist Dave the wave[_2_] Excel Programming 5 January 30th 06 11:28 PM
open file dialog-select file-import worksheet Divinedar Excel Programming 1 January 16th 04 07:13 PM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"