Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Inserting a Filename

I need to write a macro that will consolidate data from a bunch of different
files, but the files are pretty badly formatted, so I want to insert the
original filename into an extra column before I copy the data out of the
spreadsheet and paste it into the new, large spreadsheet. I was going to just
use the Cell function to get the filename, then paste values so it didn't
change when I pasted them into the new spreadsheet, but that produces errors
in my code.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Inserting a Filename

I'm not exactly sure what your question is, but you can insert the file name
into a cell with code like

Range("A1").Value = ActiveWorkbook.FullName


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)

"AlwaysFroosh!" wrote in message
...
I need to write a macro that will consolidate data from a bunch of
different
files, but the files are pretty badly formatted, so I want to insert the
original filename into an extra column before I copy the data out of the
spreadsheet and paste it into the new, large spreadsheet. I was going to
just
use the Cell function to get the filename, then paste values so it didn't
change when I pasted them into the new spreadsheet, but that produces
errors
in my code.

Any suggestions?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Inserting a Filename

Yeah, not worded the best, but you got the answer perfect! That's exactly
what I was looking for. Thanks!

"Chip Pearson" wrote:

I'm not exactly sure what your question is, but you can insert the file name
into a cell with code like

Range("A1").Value = ActiveWorkbook.FullName


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)

"AlwaysFroosh!" wrote in message
...
I need to write a macro that will consolidate data from a bunch of
different
files, but the files are pretty badly formatted, so I want to insert the
original filename into an extra column before I copy the data out of the
spreadsheet and paste it into the new, large spreadsheet. I was going to
just
use the Cell function to get the filename, then paste values so it didn't
change when I pasted them into the new spreadsheet, but that produces
errors
in my code.

Any suggestions?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Inserting a Filename

This was great..
Thanks !!
Boss

"AlwaysFroosh!" wrote:

I need to write a macro that will consolidate data from a bunch of different
files, but the files are pretty badly formatted, so I want to insert the
original filename into an extra column before I copy the data out of the
spreadsheet and paste it into the new, large spreadsheet. I was going to just
use the Cell function to get the filename, then paste values so it didn't
change when I pasted them into the new spreadsheet, but that produces errors
in my code.

Any suggestions?

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
Are there any NON-Visual Basic solutions for inserting a picture based a derived or called filename? The Great Attractor Excel Worksheet Functions 7 May 27th 07 04:38 AM
Converting a Variable Filename to a Constant Filename Magnivy Excel Programming 2 August 15th 06 06:13 PM
Inserting a filename into a cell Frank Kabel Excel Programming 4 July 16th 04 07:53 PM
Saving filename same as import filename Matt Excel Programming 4 February 24th 04 03:01 PM
Inserting Date In Filename Using Macro Mega_-__ Excel Programming 2 November 27th 03 08:51 PM


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

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

About Us

"It's about Microsoft Excel"