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
michdenis
Bonsoir Christophe,
Copie ceci dans le module feuille où l'action se déroule
Les colonnes de la procédure supposent que tes doublons sont en colonnes : A et B
'-------------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) Dim Rg As Range Set Rg = Intersect(Target, Columns("A:B")) If Not Rg Is Nothing Then For Each c In Rg a = a + 1 Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = xlNone If WorksheetFunction.CountIf(c.EntireColumn, Target) > 1 Then If Target.Column = Rg(1).Column Then Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = 3 MsgBox "La Ligne " & c.Row & " est un doublon" Else Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = 3 MsgBox "La Ligne " & c.Row & " est un doublon" End If End If Next End If Set Rg = Nothing End Sub '--------------------------------------
Salutations!
"CHRISTOPHE" a écrit dans le message de news: Bonsoir,
Soit 44 12 44 11 44 12
Je cherche la methode pour dire "attention doubon ligne 3"?
Mais sur 5000 lignes!!!
par avance merci, si c'est du code vb, une petite explication me permetrait d'apprendre
Bonsoir Christophe,
Copie ceci dans le module feuille où l'action se déroule
Les colonnes de la procédure supposent que tes doublons sont en colonnes : A et B
'--------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Rg As Range
Set Rg = Intersect(Target, Columns("A:B"))
If Not Rg Is Nothing Then
For Each c In Rg
a = a + 1
Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = xlNone
If WorksheetFunction.CountIf(c.EntireColumn, Target) > 1 Then
If Target.Column = Rg(1).Column Then
Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = 3
MsgBox "La Ligne " & c.Row & " est un doublon"
Else
Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = 3
MsgBox "La Ligne " & c.Row & " est un doublon"
End If
End If
Next
End If
Set Rg = Nothing
End Sub
'--------------------------------------
Salutations!
"CHRISTOPHE" <christophe.reina@free.fr> a écrit dans le message de news: OUXowyQxEHA.3528@TK2MSFTNGP10.phx.gbl...
Bonsoir,
Soit
44 12
44 11
44 12
Je cherche la methode pour dire "attention doubon ligne 3"?
Mais sur 5000 lignes!!!
par avance merci, si c'est du code vb, une petite explication me permetrait
d'apprendre
Copie ceci dans le module feuille où l'action se déroule
Les colonnes de la procédure supposent que tes doublons sont en colonnes : A et B
'-------------------------------------- Private Sub Worksheet_Change(ByVal Target As Range) Dim Rg As Range Set Rg = Intersect(Target, Columns("A:B")) If Not Rg Is Nothing Then For Each c In Rg a = a + 1 Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = xlNone If WorksheetFunction.CountIf(c.EntireColumn, Target) > 1 Then If Target.Column = Rg(1).Column Then Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = 3 MsgBox "La Ligne " & c.Row & " est un doublon" Else Range(Range("A" & c.Row), Range("B" & c.Row)).Interior.ColorIndex = 3 MsgBox "La Ligne " & c.Row & " est un doublon" End If End If Next End If Set Rg = Nothing End Sub '--------------------------------------
Salutations!
"CHRISTOPHE" a écrit dans le message de news: Bonsoir,
Soit 44 12 44 11 44 12
Je cherche la methode pour dire "attention doubon ligne 3"?
Mais sur 5000 lignes!!!
par avance merci, si c'est du code vb, une petite explication me permetrait d'apprendre