Bonjour,
J’importe un fichier texte dans un classeur Excel et je n’arrive pas à définir la virgule comme séparateur décimal.
Dans le code ci-dessous
.TextFileDecimalSeparator = ","
est ignoré et je ne comprends pas pourquoi. Tout le reste fonctionne correctement. Ai-je oublié quelque chose ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| With ActiveSheet.QueryTables.Add(Connection:="TEXT;" & Fichier_Importé, Destination:=Range("$A$1"))
.Name = "blabla"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
If Séparateur_Tabulation = True Then
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
Else
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
End If
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.TextFileDecimalSeparator = ","
.Refresh BackgroundQuery:=False
End With |
Merci pour votre aide
Partager