Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default Add file name somewhere in worksheet?

Hi. I have a folder of files that I am consolidating into 1 file 1, sheet.
When I consolidate into 1 file, can I append each row with the file name?

Each file is a template, so it has the same # of columns but may have
different # of rows. So, for instance, I'd like to put the name of the file
in column Z of each populated row, so when it consolidates into the single
file, I see the file name for each and every line. Any ideas? Thank you!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add file name somewhere in worksheet?


-FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls)
*.xls", _
MultiSelect:=True)
If IsArray(FName) Then
Application.ScreenUpdating = False
Set globalbook = ThisWorkbook

globalbook.Worksheets("sheet").Columns("A:Y").Clea r


For N = LBound(FName) To UBound(FName)
*globalbook.Worksheets("sheet").Cells(rnum, "A").Value
insertbook.Name*
...-

is a part of a code i used for equal exampl

--
Zur
-----------------------------------------------------------------------
Zurn's Profile: http://www.excelforum.com/member.php...fo&userid=1464
View this thread: http://www.excelforum.com/showthread.php?threadid=26420

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Add file name somewhere in worksheet?


Hi,

Would you please give me an example for how to use your code?

For instance, if I have a folder "c:\test" with these files
c:\test\file1, c:\test\file2, c:\test\file3,c:\test\file4,..
c:\test\file100" in it. Each file only has one sheet named "sheet1"
and each worksheet contains 4 columns and various numbers of rows
Column names are A, B, C, D respectively. Would you please be so kin
to tell me how to implement your code to this example?

Do I have to have VB running on my computer or can I just open one o
these files to use the VB Macro Editor to run the application?

Any help would be dearly appreciated. Thank you.

Susa

--
oasi
-----------------------------------------------------------------------
oasis's Profile: http://www.excelforum.com/member.php...fo&userid=2599
View this thread: http://www.excelforum.com/showthread.php?threadid=26420

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
How to set up a worksheet name as file name Sunil Pal Excel Discussion (Misc queries) 1 March 21st 08 04:40 AM
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
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 07:13 AM.

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"