I'm importing several small 2 column data files of dates with variations of the following macro:
After importing a few rows correctly the macro starts creating new columns and saves the data there.
The macro was captured using Data ==> From Text. This import ran ok.
Sub ENPURP()
'
' ENPURP Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Documents and Settings\Administrator\My Documents\Dropbox\Files\P_EN_UR.CSV" _
, Destination:=Range("$AG$16"))
.Name = "P_EN_UR"
.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 = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(3, 3)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
After importing a few rows correctly the macro starts creating new columns and saves the data there.
The macro was captured using Data ==> From Text. This import ran ok.