LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Importing multiple files

You need to write you own VBA excel macro

It wuld look somethin like this

sub Get Data()
PrefixFileName = "PrefixFilename"
for i = 1 to 251

MyfileName = Prefixfilename + Cstring(i) ' converts integer i to a string
Workbooks.Open Filename:=MyfileName, ReadOnly:=True
' Removed pathname from file name so it can be referenced in this program.
'Basic doesn't like the full pathname???? stupid microsoft
Do While (1)
CharPosition = InStr(MyfileName, "\")
If CharPosition 0 Then
MyfileName = Mid(MyfileName, CharPosition + 1)
Else
Exit Do
End If
Loop
Cells("A1").Copy _
Destination:=Workbooks(MyWorkbook).Worksheets
(MyWorksheetName). _
Range("F2"). _
Offset(rowOffset:=0, columnOffset:=0)
Next i
end sub
"Tommy" wrote:

I need to import financial data from 251 days, and wondered if there is a
script or method that I can use to do this, so that I dont have to repeat
"import external data" 250 times?

 
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
importing multiple .dat files! via135 Excel Worksheet Functions 0 March 29th 06 08:09 PM
Importing from multiple Excel files Tired of wasting time Excel Discussion (Misc queries) 2 September 21st 05 08:22 PM
importing multiple text files into the same worksheet Mike D Excel Discussion (Misc queries) 4 July 15th 05 10:39 AM
importing multiple text files URGENT!!! HELP tasha Excel Worksheet Functions 0 December 19th 04 04:26 PM
importing multiple text files??? tashayu Excel Discussion (Misc queries) 0 December 19th 04 02:43 PM


All times are GMT +1. The time now is 05:33 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"