Sub ImportTextFile() Dim fName As String, LastRow As Long fName = Application.GetOpenFilename("Text Files (*.txt), *.txt") If fName = "False" Then Exit Sub LastRow = Range("A" & Rows.Count).End(xlUp).Row + 1 With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & fName, _ Destination:=Range("A" & LastRow)) .Name = "sample" .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 = xlTextQualifierNone .TextFileConsecutiveDelimiter = True .TextFileTabDelimiter = False .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = True .TextFileSpaceDelimiter = False .TextFileOtherDelimiter = "" & Chr(10) & "" .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, 1, 1, 1, 1, _ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With Dim Rng As Range Dim Loc As String Dim Ch As Chart With ActiveSheet Set Rng = .Range("A1:B1").CurrentRegion Loc = .Name Set Ch = Charts.Add With Ch .ChartType = xlLineMarkers .SetSourceData Source:=Rng .Location Where:=xlLocationAsObject, Name:=Loc End With End With End Sub