Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import several txt files into separate sheets within 1 workbook
Hi everyone. I have a folder that receives data dumps from a
different system. The files are text files, contain data on only 1 sheet, are very large, and the names of the files are generated from the other system. I have code (from the newsgroup - thanks!) that enables me to select the files to be imported: Sub Combine() Dim GetFiles As Variant Dim iFiles As Long Dim nFiles As Long GetFiles = Application.GetOpenFilename _ (FileFilter:="Text Files (*.*),*.*", _ Title:="Select Files To Open", MultiSelect:=True) If TypeName(GetFiles) = "Boolean" Then ''' GetFiles is False if GetOpenFileName is Canceled MsgBox "No Files Selected", vbOKOnly, "Nothing Selected" End Else ''' GetFiles is Array of Strings (File Names) ''' File names include Path nFiles = UBound(GetFiles) For iFiles = 1 To nFiles '' List Files in Immediate Window Debug.Print GetFiles(iFiles) Next End If End Sub But now I don't know how to copy the data into a seperate worksheet within the same workbook. So basically, I'd like to choose and consolidate multiple text files into 1 excel workbook containing many worksheets. I have very limited knowledge of VBA. Thanks so much!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto saving sheets from a workbook as separate files. | Excel Worksheet Functions | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Import 2 text files into 2 separate columns? | Excel Discussion (Misc queries) | |||
workbook sheets into separate files | Excel Worksheet Functions | |||
How do I save sheets in a workbook to separate files? | Excel Worksheet Functions |