Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Import multiple text files (Macro)

I've got multiple text files with data in a consistent format like
this:

Header1: Text1
Header2: Text2
Header3: Text3
etc.


I'd like to import all the text files. I'd also like to change the
direction of the data so that it's horizontal rather than vertical. The

Header information can be disregarded. I recorded a macro that imports
the data but I don't know how to modify it to do what I want.


Can someone help? Thanks


Here's the Macro. I'd like the destination to be consecutive and there
is no rhyme nor reason to the text name (m07162717).


Sub Import()
'
' Import Macro
' Macro recorded 9/18/2006 by baumgabt
'


'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Documents and Settings\BaumgaBT\Desktop\WSP
MSG\m07162717.032", _
Destination:=Range("A1"))
.Name = "m07162717"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = ":"
.TextFileColumnDataTypes = Array(9, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub

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
text import all in one column. how do I set it to multiple column maggie Hettinger New Users to Excel 2 April 10th 06 04:49 PM
Import 2 text files into 2 separate columns? tcurrier Excel Discussion (Misc queries) 3 February 11th 06 07:13 PM
How do I change the default location for importing text files? BWTreadway Excel Discussion (Misc queries) 0 September 30th 05 06:39 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??? tashayu Excel Discussion (Misc queries) 0 December 19th 04 02:43 PM


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