LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I import text file, analyze data, export results, open next file

assume the 3000 names are in a worksheet name filenames in a workbook name
MasterList.xls
Assume the summary sheet is the first sheet in a workbook named Summary.xls

Sub Process3000()
Dim bk as workbook
Dim cell as Range
Dim rng as Range
Dim rng1 as Range
Dim rng3 as Range
for each cell in Workbooks("MasterList.xls"). _
worksheets("Filenames").Range(A1:A3000")
set bk = workBooks.open(cell.name)
set rng = bk.Activesheet.Range("A1").currentRegion
rng.Sort Key1:=bk.Activesheet.Range("A1")
' perform unspecified calculations
' assume a new row is added at the bottom with formula
' as an example.
set rng3 = bk.Activesheet.Cells(rows.count,1).End(xlup)
rng3.Resize(1,4).FormulR1C1 = "=Sum(R1C:R[-1]C)"
rng3.offset(0,2).Value = "Yes"
copy that line to the summation workbook
set rng1 = Workbooks("Summary.xls").worksheets(1) _
cells(rows.count,1).End(xlup)(2)

rng3.offset(0,1).Resize(1,4).copy
rng1.offset(0,1).Pastespecial xlValues
rng1.Value = cell.Value ' file name
bk.close Savechanges:=False
Next
End sub

Of course you have not defined your analysis, so I just gave an example
where such code would be place.

--
Regards,
Tom Ogilvy



"Geoffro" wrote in message
oups.com...
Whoops! I guess my email addy can't show up that way. It's

geoffro10 at yahoo dot com

Thanks!



 
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
Export / Import to / from Text file C_Ascheman Excel Programming 6 February 22nd 05 11:49 PM
Import/Export Text File Tab Delimiter Cool Sport Excel Programming 3 December 20th 04 12:22 PM
Using Message Box to Open/Import Text File hjones Excel Programming 1 November 18th 03 06:20 PM
Use VBA code to open a text file with the import wizard George Wilson[_2_] Excel Programming 2 September 10th 03 07:55 PM
Get External Data, Import Text File, File name problem Scott Riddle Excel Programming 1 July 11th 03 05:40 PM


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

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"