Caractère séparateur sous excel VBA
Résolu
mmmxtina
-
mmmxtina Messages postés 70 Statut Membre -
mmmxtina Messages postés 70 Statut Membre -
Bonjour tout le monde!!!
J'ai un soucis!
Je dois importer un fichier texte sous excel, mais le problème c'est que mon séparateur c'est ":" et pas ";", donc cu coup c'est mal délimiter.
je vous montre le code:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & Monchemin _
, Destination:=Range("A1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlMSDOS
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote 'ça ne fonctionne pas avec les ":"
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 _
, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(3, 14, 32, 32, 5, 20, 10, 30, 9, 12, 8, 32, 5, 32, 2, 15, 1 _
, 10, 1, 20, 10, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Une idée? j'ai repris la fonction d'un collègue il me semble qu'il a paramétrer la taille des colonne, m'enfin pas trop compris j'avou.
Merciiiiiiiii à tous d'avance!
J'ai un soucis!
Je dois importer un fichier texte sous excel, mais le problème c'est que mon séparateur c'est ":" et pas ";", donc cu coup c'est mal délimiter.
je vous montre le code:
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & Monchemin _
, Destination:=Range("A1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlMSDOS
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote 'ça ne fonctionne pas avec les ":"
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 _
, 1, 1, 1, 1, 1)
.TextFileFixedColumnWidths = Array(3, 14, 32, 32, 5, 20, 10, 30, 9, 12, 8, 32, 5, 32, 2, 15, 1 _
, 10, 1, 20, 10, 9)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Une idée? j'ai repris la fonction d'un collègue il me semble qu'il a paramétrer la taille des colonne, m'enfin pas trop compris j'avou.
Merciiiiiiiii à tous d'avance!
A voir également:
- Textfileparsetype
- Caractère ascii - Guide
- Caractère spéciaux - Guide
- Liste déroulante excel - Guide
- Caractere speciaux - Guide
- Word et excel gratuit - Guide