Hi All,
I recorded a macro as i wanted the line breaks to be in specific locations. Only trouble is when i recorded the macro, the default location to put the data was cell A2.
I actually need Excel to put sequential textpad imports into the next empty row. (Ie, if there is data in column 355, start the next import in column 356).
Current Code as follows:
Sub Import_TXT()
'
' Import_TXT Macro
' Import Files created by ODM Shortrec
'
' Keyboard Shortcut: Ctrl+Shift+F
'
Dim sfilename As String
sfilename = Application.GetOpenFilename
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & sfilename, Destination:=Range("A2"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(10, 14, 7, 35, 30, 4, 36, 8, 26, 11, 7, 7, 7, 13, 10, 3 _
, 4, 4, 19, 25, 13, 17, 16, 2, 348, 20, 30, 80, 2, 2, 34, 40, 15, 17, 5, 63)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
How can i change this?
Thanks so much,
red_dot
Bookmarks