Hi Steve, Ignore the first email. It was incomplete. Try this. Remember the extra End With near the end. Regards - Dave.
Dim myFileName As Variant myFileName = Application.GetOpenFilename(filefilter:="Text Files, *.txt") If myFileName = False Then Exit Sub 'user hits cancel With ActiveSheet With .QueryTables.Add(Connection:="TEXT;" & myFileName, Destination:=.Range("A1")) > .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 = 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) > .TextFileFixedColumnWidths = Array(20, 88, 60, 6, 2, 60, 30, > 12, 1, 20, 4, 9, 6, 12, 10, _ > 10, 12) > .TextFileTrailingMinusNumbers = True > .Refresh BackgroundQuery:=False > End With End With > End Sub > > > Any help would be greatly appreciated. > > Thanks, > > Steve > > > _________________________________________________________________ It's simple! Sell your car for just $40 at CarPoint.com.au http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT --~--~---------~--~----~------------~-------~--~----~ Visit the blog to download Excel tutorials at http://www.excel-macros.blogspot.com To post to this group, send email to excel-macros@googlegroups.com For more options, visit this group at http://groups.google.com/group/excel-macros?hl=en Visit & Join Our Orkut Community at http://www.orkut.com/Community.aspx?cmm=22913620 To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com To see the Daily Excel Tips, Go to: http://exceldailytip.blogspot.com If you find any spam message in the group, please send an email to Ayush @ jainayus...@gmail.com -~----------~----~----~----~------~----~------~--~---