Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
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
Auto saving sheets from a workbook as separate files. Colin Hayes Excel Worksheet Functions 2 May 18th 10 06:50 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Import 2 text files into 2 separate columns? tcurrier Excel Discussion (Misc queries) 3 February 11th 06 07:13 PM
workbook sheets into separate files markx Excel Worksheet Functions 1 June 28th 05 04:02 PM
How do I save sheets in a workbook to separate files? Omzala Excel Worksheet Functions 2 January 13th 05 06:23 PM


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