Z
zZyXx
Column A has names of textfiles that need to be imported into collum
B.
So far I've got this code:
colIndex = 1
For rwIndex = 1 To 10
With ActiveSheet.Cells(rwIndex, colIndex)
Location = "TEXT;S:\test\" + Mid(.Value, 3) + ".txt"
End With
With ActiveSheet.QueryTables.Add(Connection:=Location
Destination:=ActiveSheet.Cells(rwIndex, 2))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Next rwIndex
Is this the appropriate way to do this?
Textfiles with more than 1 line get imported into several cell
underneath eachother. I need each textfile to get imported into on
cell with all the lines in that cell. How do I do that
B.
So far I've got this code:
colIndex = 1
For rwIndex = 1 To 10
With ActiveSheet.Cells(rwIndex, colIndex)
Location = "TEXT;S:\test\" + Mid(.Value, 3) + ".txt"
End With
With ActiveSheet.QueryTables.Add(Connection:=Location
Destination:=ActiveSheet.Cells(rwIndex, 2))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Next rwIndex
Is this the appropriate way to do this?
Textfiles with more than 1 line get imported into several cell
underneath eachother. I need each textfile to get imported into on
cell with all the lines in that cell. How do I do that