M-Help
01-23-2014, 07:40 AM
Hello,
I'm trying to import data but I need the row count to be +1.
I tried multiple things without luck.
example of what I need;
"TEXT;C:\temp\data.txt", Destination:=Range("A" & Rows.Count + 1).End(xlUp).Offset(1, 0))
Any help will be appreciated.
Thank you,
Sub Import_Data()
'
' Import_Data Macro
'
'Insert row above active cell
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\temp\data.txt", Destination:=Range("A" & Rows.Count).End(xlUp).Offset(1, 0))
.Name = "Device Uptime"
.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 = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub
I'm trying to import data but I need the row count to be +1.
I tried multiple things without luck.
example of what I need;
"TEXT;C:\temp\data.txt", Destination:=Range("A" & Rows.Count + 1).End(xlUp).Offset(1, 0))
Any help will be appreciated.
Thank you,
Sub Import_Data()
'
' Import_Data Macro
'
'Insert row above active cell
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\temp\data.txt", Destination:=Range("A" & Rows.Count).End(xlUp).Offset(1, 0))
.Name = "Device Uptime"
.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 = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub