I have a CSV File, which I want to display in my Spreadsheet using the QueryTable.
Because I have long numbers, I want to format the cells as text (because the last digits are turned to a "0").
I tried formatting the cells beforehand and setting the "PreserveFormatting" to True, but this leaves me still with a "E+16"-number and if I click on it, the last 2 digits are replaced with "0".
Do you know a way, to get the full number written as a Text into the cell?
This is my CSV:
1,Name1,Surname1,26778942223654789,,,,,,,,,,,
2,Name2,Surname2,31678678797467889,,,,,,,,,,,
3,Name3,Surname3,31657894475133527,,,,,,,,,,,
4,Name4,Surname4,35448512368896137,,,,,,,,,,,
And this is my Code:
Sub Personen_importieren()
import_path = Range("A2").Text
If import_path <> False Then
With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & import_path,_ Destination:=ActiveSheet.Range("A9"))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.PreserveFormatting = True
.AdjustColumnWidth = False
.Refresh
End With
End If
End Sub