Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Import text file : why do fractions in text format result in month/day?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I import XML as text format Huw Excel Discussion (Misc queries) 1 July 28th 06 04:09 PM
Text import format question mlaplante Excel Discussion (Misc queries) 1 July 20th 06 02:31 PM
How do I import text file, analyze data, export results, open next file Geoffro Excel Programming 2 March 6th 05 08:02 PM
Format number as text on import Ron Swinehart Excel Discussion (Misc queries) 3 March 4th 05 10:59 PM
Excel Addin altering date format on text file import RJ Lohan[_2_] Excel Programming 3 March 3rd 05 01:09 AM


All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"