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
Pierre Fauconnier
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
-- Pierre Fauconnier () "Le bonheur n'est pas au bout du chemin. Le bonheur EST le chemin ( proverbe zen ) Remplacez nospam.nospam par pfi.be pour répondre. Merci
j'aimerais qu' a chaque changement de valeur dans la colonne B insérer une ligne vide
il n'y a pas forcément le même nombre de valeurs identiques
merci d'avance pour votre aide
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = 1 To Ligne
If Range("b" & i) <> Range("b" & i + 1) Then
Range("b" & i + 1).EntireRow.Insert shift:=xlUp
i = i + 1
End If
Next i
End Sub
Ok?
--
Pierre Fauconnier (pierre.fauconnier@nospam.nospam)
"Le bonheur n'est pas au bout du chemin. Le bonheur EST le chemin ( proverbe
zen )
Remplacez nospam.nospam par pfi.be pour répondre. Merci
"Andréa Parker" <NoSpam.andrea.parker@laposte.net> a écrit dans le message
de news: 425CBE1F.6050302@laposte.net...
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
-- Pierre Fauconnier () "Le bonheur n'est pas au bout du chemin. Le bonheur EST le chemin ( proverbe zen ) Remplacez nospam.nospam par pfi.be pour répondre. Merci
j'aimerais qu' a chaque changement de valeur dans la colonne B insérer une ligne vide
il n'y a pas forcément le même nombre de valeurs identiques
merci d'avance pour votre aide
Andréa Parker
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore ===========================================
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à
entre 300 et 400
Cde Réf
50 95
51 95
52 95
53 22
54 22
55 22
56 100
57 100
58 200
59 200
60 200
61 200
62 300
63 300
64 300
65 300
66 400
67 400
68 400
69 400
et peut-on éviter qu'il ajoute une ligne sous le titre ?
merci encore
===========================================
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = 1 To Ligne
If Range("b" & i) <> Range("b" & i + 1) Then
Range("b" & i + 1).EntireRow.Insert shift:=xlUp
i = i + 1
End If
Next i
End Sub
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore ===========================================
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
Ellimac
Bonjour,
Sub Toto() Range("B2").Select der = Range("b50000").End(xlUp).Row While ActiveCell.Row <> der If ActiveCell = ActiveCell.Offset(1) Then ActiveCell.Offset(1).Select Else ActiveCell.Offset(1).EntireRow.Insert ActiveCell.Offset(2).Select End If der = Range("b50000").End(xlUp).Row Wend End Sub
Camille
-----Message d'origine----- merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à
entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore ======================== ====================
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp
i = i + 1 End If Next i End Sub
Ok?
.
Bonjour,
Sub Toto()
Range("B2").Select
der = Range("b50000").End(xlUp).Row
While ActiveCell.Row <> der
If ActiveCell = ActiveCell.Offset(1) Then
ActiveCell.Offset(1).Select
Else
ActiveCell.Offset(1).EntireRow.Insert
ActiveCell.Offset(2).Select
End If
der = Range("b50000").End(xlUp).Row
Wend
End Sub
Camille
-----Message d'origine-----
merci
il y a juste un phénomène bizarre, il n'ajoute pas de
ligne à
entre 300 et 400
Cde Réf
50 95
51 95
52 95
53 22
54 22
55 22
56 100
57 100
58 200
59 200
60 200
61 200
62 300
63 300
64 300
65 300
66 400
67 400
68 400
69 400
et peut-on éviter qu'il ajoute une ligne sous le titre ?
merci encore
======================== ====================
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = 1 To Ligne
If Range("b" & i) <> Range("b" & i + 1) Then
Range("b" & i + 1).EntireRow.Insert
shift:=xlUp
Sub Toto() Range("B2").Select der = Range("b50000").End(xlUp).Row While ActiveCell.Row <> der If ActiveCell = ActiveCell.Offset(1) Then ActiveCell.Offset(1).Select Else ActiveCell.Offset(1).EntireRow.Insert ActiveCell.Offset(2).Select End If der = Range("b50000").End(xlUp).Row Wend End Sub
Camille
-----Message d'origine----- merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à
entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore ======================== ====================
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp
i = i + 1 End If Next i End Sub
Ok?
.
ChrisV
Bonjour Andrea,
Sub zaza() Dim i As Long Application.ScreenUpdating = False For i = [B65536].End(xlUp).Row To 3 Step -1 If Cells(i, 2) <> Cells(i - 1, 2) Then Cells(i, 2).EntireRow.Insert Shift:=xlDown End If Next i End Sub
ChrisV
"Andréa Parker" a écrit dans le message de news:
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
Bonjour Andrea,
Sub zaza()
Dim i As Long
Application.ScreenUpdating = False
For i = [B65536].End(xlUp).Row To 3 Step -1
If Cells(i, 2) <> Cells(i - 1, 2) Then
Cells(i, 2).EntireRow.Insert Shift:=xlDown
End If
Next i
End Sub
ChrisV
"Andréa Parker" <NoSpam.andrea.parker@laposte.net> a écrit dans le message
de news: 425CC73E.3010007@laposte.net...
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à
entre 300 et 400
Cde Réf
50 95
51 95
52 95
53 22
54 22
55 22
56 100
57 100
58 200
59 200
60 200
61 200
62 300
63 300
64 300
65 300
66 400
67 400
68 400
69 400
et peut-on éviter qu'il ajoute une ligne sous le titre ?
merci encore
=========================================== >
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = 1 To Ligne
If Range("b" & i) <> Range("b" & i + 1) Then
Range("b" & i + 1).EntireRow.Insert shift:=xlUp
i = i + 1
End If
Next i
End Sub
Sub zaza() Dim i As Long Application.ScreenUpdating = False For i = [B65536].End(xlUp).Row To 3 Step -1 If Cells(i, 2) <> Cells(i - 1, 2) Then Cells(i, 2).EntireRow.Insert Shift:=xlDown End If Next i End Sub
ChrisV
"Andréa Parker" a écrit dans le message de news:
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
Pierre Fauconnier
Et en plus, je le dis toujours, qu'il faut commencer par le bas... Faites ce que je dis, pas ce que je fais... ;-))
Bonne journée
Pierre
"anonymousA" a écrit dans le message de news:
bonjour,
en fait il faut prendre le problème à l'envers,c.à.d partir du bas pour remonter car autrement la valuer de ligne n'étant pas incrémentée, comme on ajoute des lignes dès que le nombre d'itérations est égal à ligne , celle-ci s'arrête alors que le fait d'avoir rajouté des lignes implique forcément que des élements ne seront pas testés ce qui n'est pas génant en dessous d'ue valeur limite mais que visiblement tu as atteinte. En partant du bas , la question ne se pose jamais.
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = Ligne To 3 Step -1 If Range("b" & i) <> Range("b" & i - 1) Then Range("b" & i).EntireRow.Insert shift:=xlDown End If Next i MsgBox i End Sub
A+
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
Et en plus, je le dis toujours, qu'il faut commencer par le bas... Faites ce
que je dis, pas ce que je fais... ;-))
Bonne journée
Pierre
"anonymousA" <anonymousA@discussions.microsoft.com> a écrit dans le message
de news: 59951DC1-5797-4286-ACB7-59DC6FBBA983@microsoft.com...
bonjour,
en fait il faut prendre le problème à l'envers,c.à.d partir du bas pour
remonter car autrement la valuer de ligne n'étant pas incrémentée, comme
on
ajoute des lignes dès que le nombre d'itérations est égal à ligne ,
celle-ci
s'arrête alors que le fait d'avoir rajouté des lignes implique forcément
que
des élements ne seront pas testés ce qui n'est pas génant en dessous d'ue
valeur limite mais que visiblement tu as atteinte.
En partant du bas , la question ne se pose jamais.
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = Ligne To 3 Step -1
If Range("b" & i) <> Range("b" & i - 1) Then
Range("b" & i).EntireRow.Insert shift:=xlDown
End If
Next i
MsgBox i
End Sub
A+
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à
entre 300 et 400
Cde Réf
50 95
51 95
52 95
53 22
54 22
55 22
56 100
57 100
58 200
59 200
60 200
61 200
62 300
63 300
64 300
65 300
66 400
67 400
68 400
69 400
et peut-on éviter qu'il ajoute une ligne sous le titre ?
merci encore
=========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = 1 To Ligne
If Range("b" & i) <> Range("b" & i + 1) Then
Range("b" & i + 1).EntireRow.Insert shift:=xlUp
i = i + 1
End If
Next i
End Sub
Et en plus, je le dis toujours, qu'il faut commencer par le bas... Faites ce que je dis, pas ce que je fais... ;-))
Bonne journée
Pierre
"anonymousA" a écrit dans le message de news:
bonjour,
en fait il faut prendre le problème à l'envers,c.à.d partir du bas pour remonter car autrement la valuer de ligne n'étant pas incrémentée, comme on ajoute des lignes dès que le nombre d'itérations est égal à ligne , celle-ci s'arrête alors que le fait d'avoir rajouté des lignes implique forcément que des élements ne seront pas testés ce qui n'est pas génant en dessous d'ue valeur limite mais que visiblement tu as atteinte. En partant du bas , la question ne se pose jamais.
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = Ligne To 3 Step -1 If Range("b" & i) <> Range("b" & i - 1) Then Range("b" & i).EntireRow.Insert shift:=xlDown End If Next i MsgBox i End Sub
A+
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
Andréa Parker
impec
merciiiiiiiiiiiiiiiiiiiiiiiiiii
Ellimac a écrit:
Bonjour,
Sub Toto() Range("B2").Select der = Range("b50000").End(xlUp).Row While ActiveCell.Row <> der If ActiveCell = ActiveCell.Offset(1) Then ActiveCell.Offset(1).Select Else ActiveCell.Offset(1).EntireRow.Insert ActiveCell.Offset(2).Select End If der = Range("b50000").End(xlUp).Row Wend End Sub
Camille
-----Message d'origine----- merci
il y a juste un phénomène bizarre, il n'ajoute pas de
ligne à
entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert
shift:=xlUp
i = i + 1 End If Next i End Sub
Ok?
.
impec
merciiiiiiiiiiiiiiiiiiiiiiiiiii
Ellimac a écrit:
Bonjour,
Sub Toto()
Range("B2").Select
der = Range("b50000").End(xlUp).Row
While ActiveCell.Row <> der
If ActiveCell = ActiveCell.Offset(1) Then
ActiveCell.Offset(1).Select
Else
ActiveCell.Offset(1).EntireRow.Insert
ActiveCell.Offset(2).Select
End If
der = Range("b50000").End(xlUp).Row
Wend
End Sub
Camille
-----Message d'origine-----
merci
il y a juste un phénomène bizarre, il n'ajoute pas de
ligne à
entre 300 et 400
Cde Réf
50 95
51 95
52 95
53 22
54 22
55 22
56 100
57 100
58 200
59 200
60 200
61 200
62 300
63 300
64 300
65 300
66 400
67 400
68 400
69 400
et peut-on éviter qu'il ajoute une ligne sous le titre ?
merci encore
=========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = 1 To Ligne
If Range("b" & i) <> Range("b" & i + 1) Then
Range("b" & i + 1).EntireRow.Insert
Sub Toto() Range("B2").Select der = Range("b50000").End(xlUp).Row While ActiveCell.Row <> der If ActiveCell = ActiveCell.Offset(1) Then ActiveCell.Offset(1).Select Else ActiveCell.Offset(1).EntireRow.Insert ActiveCell.Offset(2).Select End If der = Range("b50000").End(xlUp).Row Wend End Sub
Camille
-----Message d'origine----- merci
il y a juste un phénomène bizarre, il n'ajoute pas de
ligne à
entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert
shift:=xlUp
i = i + 1 End If Next i End Sub
Ok?
.
Andréa Parker
impec aussi
j'ai l'embarras du choix
merci à tous
============================== ChrisV a écrit:
Bonjour Andrea,
Sub zaza() Dim i As Long Application.ScreenUpdating = False For i = [B65536].End(xlUp).Row To 3 Step -1 If Cells(i, 2) <> Cells(i - 1, 2) Then Cells(i, 2).EntireRow.Insert Shift:=xlDown End If Next i End Sub
ChrisV
"Andréa Parker" a écrit dans le message de news:
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub
Ok?
impec aussi
j'ai l'embarras du choix
merci à tous
==============================
ChrisV a écrit:
Bonjour Andrea,
Sub zaza()
Dim i As Long
Application.ScreenUpdating = False
For i = [B65536].End(xlUp).Row To 3 Step -1
If Cells(i, 2) <> Cells(i - 1, 2) Then
Cells(i, 2).EntireRow.Insert Shift:=xlDown
End If
Next i
End Sub
ChrisV
"Andréa Parker" <NoSpam.andrea.parker@laposte.net> a écrit dans le message
de news: 425CC73E.3010007@laposte.net...
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à
entre 300 et 400
Cde Réf
50 95
51 95
52 95
53 22
54 22
55 22
56 100
57 100
58 200
59 200
60 200
61 200
62 300
63 300
64 300
65 300
66 400
67 400
68 400
69 400
et peut-on éviter qu'il ajoute une ligne sous le titre ?
merci encore
=========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes()
Dim Cellule As Range
Dim Ligne As Long
Dim i As Long
Ligne = Range("b65536").End(xlUp).Row
For i = 1 To Ligne
If Range("b" & i) <> Range("b" & i + 1) Then
Range("b" & i + 1).EntireRow.Insert shift:=xlUp
i = i + 1
End If
Next i
End Sub
Sub zaza() Dim i As Long Application.ScreenUpdating = False For i = [B65536].End(xlUp).Row To 3 Step -1 If Cells(i, 2) <> Cells(i - 1, 2) Then Cells(i, 2).EntireRow.Insert Shift:=xlDown End If Next i End Sub
ChrisV
"Andréa Parker" a écrit dans le message de news:
merci
il y a juste un phénomène bizarre, il n'ajoute pas de ligne à entre 300 et 400
Cde Réf
50 95 51 95 52 95
53 22 54 22 55 22
56 100 57 100
58 200 59 200 60 200 61 200
62 300 63 300 64 300 65 300 66 400 67 400 68 400 69 400 et peut-on éviter qu'il ajoute une ligne sous le titre ? merci encore =========================================== >>
Pierre Fauconnier a écrit:
Bonjour
Il y a peut-être plus académique
Sub Inserer_Lignes() Dim Cellule As Range Dim Ligne As Long Dim i As Long
Ligne = Range("b65536").End(xlUp).Row For i = 1 To Ligne If Range("b" & i) <> Range("b" & i + 1) Then Range("b" & i + 1).EntireRow.Insert shift:=xlUp i = i + 1 End If Next i End Sub