Bonjour a tous,
J'aimerai faire une macro VBA Excel pour transformer les lignes se trouvant dans une cellule en plusieurs colonne de sorte que les données ne soient pas alignés sur chaque ligne dans la cellule mais en plusieurs colonne côte-à-côte. (j'espère me faire comprendre!!!) J'ai essayé ça mais ça ne marche pas. si quelqu'un peux me corriger svp !
Sub transform_cellule()
Dim motaverif As String
Dim temp As String, alpha As String
Dim i As Long, j As Long, k As Long, posi As Long
alpha = Chr(10)
k = 1
motaverif = ActiveCell.Value
i = ActiveCell.Row
j = ActiveCell.Column
Do
temp = Mid(motaverif, k, 1)
posi = InStr(temp, alpha)
Cells(i, j + 1).Value = Right(motaverif, Len(motaverif) - posi + 2)
motaverif = Right(motaverif, Len(motaverif) - posi + 2)
j = j + 1
k = k + 1
Loop Until k > Len(motaverif)
End sub
Configuration: Windows vista
Firefox 3.0.5