creer insertion de ligne sur rupture suite numérique
1 réponse
jipaih
bonjour
en col C j'ai des suites de nombres avec des ruptures (ex:
2,3,4,5,12,13,14,15,56,57....
comment creer une ligne vide à chaque fois qu'il y a interruption de
cette suite ?
merci
--
Enlever NonNon dans l'adresse pour réponse directe. Merci
Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
AV
en col C j'ai des suites de nombres avec des ruptures (ex: 2,3,4,5,12,13,14,15,56,57.... comment creer une ligne vide à chaque fois qu'il y a interruption de cette suite ?
La suite de nombres est en C2:Cxxx :
Sub zz_Suite() Application.ScreenUpdating = False premL = 2 ' 1° ligne For i = [c65536].End(3).Row To 2 Step -1 If Cells(i, "c").Row = premL Then Exit Sub If Cells(i - 1, "c") <> Cells(i, "c") - 1 Then x = Cells(i, "c") Cells(i, "c").Insert Cells(i, "c") = x - 1 x = 0: i = i + 1 End If Next End Sub
AV
en col C j'ai des suites de nombres avec des ruptures (ex:
2,3,4,5,12,13,14,15,56,57....
comment creer une ligne vide à chaque fois qu'il y a interruption de
cette suite ?
La suite de nombres est en C2:Cxxx :
Sub zz_Suite()
Application.ScreenUpdating = False
premL = 2 ' 1° ligne
For i = [c65536].End(3).Row To 2 Step -1
If Cells(i, "c").Row = premL Then Exit Sub
If Cells(i - 1, "c") <> Cells(i, "c") - 1 Then
x = Cells(i, "c")
Cells(i, "c").Insert
Cells(i, "c") = x - 1
x = 0: i = i + 1
End If
Next
End Sub
en col C j'ai des suites de nombres avec des ruptures (ex: 2,3,4,5,12,13,14,15,56,57.... comment creer une ligne vide à chaque fois qu'il y a interruption de cette suite ?
La suite de nombres est en C2:Cxxx :
Sub zz_Suite() Application.ScreenUpdating = False premL = 2 ' 1° ligne For i = [c65536].End(3).Row To 2 Step -1 If Cells(i, "c").Row = premL Then Exit Sub If Cells(i - 1, "c") <> Cells(i, "c") - 1 Then x = Cells(i, "c") Cells(i, "c").Insert Cells(i, "c") = x - 1 x = 0: i = i + 1 End If Next End Sub