cs_jeyjey1
Messages postés46Date d'inscriptionmardi 3 avril 2007StatutMembreDernière intervention 8 février 2010
-
8 févr. 2010 à 11:56
cs_jeyjey1
Messages postés46Date d'inscriptionmardi 3 avril 2007StatutMembreDernière intervention 8 février 2010
-
8 févr. 2010 à 13:32
Bonjour
J'ai un probleme dont l'issue m'échappe. Le programme fonctionne très bien pour une ligne mais je n'arrive pas a lui dire de continuer avec la ligne du dessous, mon "for each" est complétement transparent. Auriez vous une idée ? merci.
Sub selection_unite()
Dim cellule As Range
Dim oldCalculation As Variant '
Dim reponse As Variant
Dim motaverif As String
Dim temp As String, alpha As String
Dim i As Long, j As Long, k As Long, posi As Long
Dim test As Boolean
Dim val1 As String
Set reponse = Range("A1:A100")
For Each cellule In reponse
alpha = Chr(10)
k = 1
test = False
motaverif = ActiveCell.Value
i = ActiveCell.Row
j = ActiveCell.Column
Do While k <= Len(motaverif)
temp = Mid(motaverif, k, 1)
posi = InStr(motaverif, alpha)
test = posi > 0
If test Then
Cells(i, j).Value = Left(motaverif, posi - 1)
Cells(i, j + 1).Value = Right(motaverif, Len(motaverif) - posi)
motaverif = Cells(i, j + 1).Value
k = 0
j = j + 1
End If
k = k + 1
Loop
Next cellule
End Sub