H
hermac
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.Count)).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
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.Count)).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