A voir également:
- Module de recherche VB dans Excel
- Liste déroulante excel - Guide
- Word et excel gratuit - Guide
- Recherche automatique des chaînes ne fonctionne pas - Guide
- Déplacer colonne excel - Guide
- Si ou excel - Guide
2 réponses
Sub Macro1()
A toi a choisir l endroit et le formùat de la restitution
Dim ValA1, x, ValB1, cpt, i As Integer
i = 1
cpt = 0
x = 1
Do While Range("A" & i).Value <> ""
ValA1 = Range("A" & i).Value
ValB1 = Range("B" & i).Value
Do While (Range("B" & i).Value) + 1 = Range("B" & (i + 1)).Value
i = i + 1
cpt = cpt + 1
Loop
If cpt >= 4 Then
Range("C" & x).Value = ValA1
Range("D" & x).Value = ValB1
Range("E" & x).Value = Range("A" & i).Value
Range("F" & x).Value = Range("B" & i).Value
x = x + 1
End If
cpt = 0
i = i + 1
Loop
End Sub
A toi a choisir l endroit et le formùat de la restitution
Dim ValA1, x, ValB1, cpt, i As Integer
i = 1
cpt = 0
x = 1
Do While Range("A" & i).Value <> ""
ValA1 = Range("A" & i).Value
ValB1 = Range("B" & i).Value
Do While (Range("B" & i).Value) + 1 = Range("B" & (i + 1)).Value
i = i + 1
cpt = cpt + 1
Loop
If cpt >= 4 Then
Range("C" & x).Value = ValA1
Range("D" & x).Value = ValB1
Range("E" & x).Value = Range("A" & i).Value
Range("F" & x).Value = Range("B" & i).Value
x = x + 1
End If
cpt = 0
i = i + 1
Loop
End Sub