Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionderlig = Range("A" & Rows.Count).End(xlUp).Row Dim toto As Range For i = 2 To derlig + 1 If Range("A" & i - 1).Value = Range("A" & i).Value Then Set toto = Union(Range("A" & i - 1 & ":C" & i - 1), Range("A" & i & ":C" & i)) Else MsgBox toto.Address Set toto = Range("A" & i & ":C" & i) If i > derlig Then Exit For End If Next
derlig = Range("A" & Rows.Count).End(xlUp).Row Dim toto As Range Set toto = Range("A1:C1") For i = 2 To derlig + 1 If Range("A" & i - 1).Value = Range("A" & i).Value Then Set toto = Union(toto, Range("A" & i & ":C" & i)) Else MsgBox toto.Address Set toto = Range("A" & i & ":C" & i) If i > derlig Then Exit For End If Next
Dim deb As Long, i As Long, titi As Range, toto() toto = Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row + 1) deb = 1 For i = 2 To UBound(toto) If toto(i, 1) <> toto(deb, 1) Or i = UBound(toto) Then Set titi = Range("A" & deb & ":C" & i - 1) MsgBox "plage " & titi.Address & " à copier dans feuil1 d'un classeur à créer sous le nom " & Range("A" & deb).Text & ".xls" deb = i End If Next