Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I manually import a .txt file with the DATA menu "Import Text File"
and specify column 1 as text and columns 2, 3 and 4 as general I get de result I wanted. Fractions like 10/15 are shown as such. I recorded this proces and , except for the first 2 lines, the code I read is this : Main.Worksheets.Add(After:=Worksheets(Worksheets.C ount)).Name = "Import" With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & FTO, Destination:=Range("B1")) .Name = "VanHool4_1" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .TextFilePromptOnRefresh = False .TextFilePlatform = xlWindows .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileOtherDelimiter = "!" .TextFileColumnDataTypes = Array(2, 1, 1, 1) .Refresh BackgroundQuery:=False End With Then I wrote a sub where I added the first 2 lines ; the rest I just pasted underneath. It works fine but SOME ratios in column 1 , like 10/15 , now show like oct/15 which I don't want. Could anyone help me here? I really need that original 10/15 as text. Thank you very much for any input. Herman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I import XML as text format | Excel Discussion (Misc queries) | |||
Text import format question | Excel Discussion (Misc queries) | |||
How do I import text file, analyze data, export results, open next file | Excel Programming | |||
Format number as text on import | Excel Discussion (Misc queries) | |||
Excel Addin altering date format on text file import | Excel Programming |