Pas de doublons lors de la saisie

S

sev

Guest
Bonjour , je vous expose un nouveau problème :

Lorsque j'effectue une saisie dans un tableau , je voudrais que si la valeure existe déjà en colonne G que la ligne soit remplacée par la nouvelle saisie.

[CODE
Private Sub CommandButton1_Click()
Sheets("Signalements").Unprotect
Dim DerLigne As Integer
DerLigne = Sheets("Signalements").Range("A65536").End(xlUp).Row + 1


With Sheets("Signalements")
.Activate
.Range("A1").Select
With .Range("G" & DerLigne)
With .Font
.Name = MyCellFont
.Bold = MyCellBold
.Italic = MyCellItalic

End With
.Value = MyCellValue
End With


.Range("A" & DerLigne) = TextBox3.Value
.Range("B" & DerLigne) = TextBox2.Value
.Range("C" & DerLigne) = TextBox1.Value
.Range("G" & DerLigne) = Format(TextBox4, "000")
.Range("H" & DerLigne) = Format(TextBox9, "00 00")
.Range("I" & DerLigne) = TextBox38.Value
.Range("J" & DerLigne) = TextBox12
.Range("K" & DerLigne) = TextBox13

If TextBox70 <> "" Then
.Range("L" & DerLigne) = TextBox70 & " + " & TextBox8
Else
.Range("L" & DerLigne) = TextBox8
End If

TextBox4.Value = ""
TextBox8.Value = ""
TextBox38.Value = ""
TextBox9.Value = ""
TextBox12.Value = ""
TextBox13.Value = ""
TextBox70.Value = ""


TextBox12.SetFocus
TextBox13.SetFocus
TextBox8.SetFocus
TextBox38.SetFocus
TextBox4.SetFocus
TextBox70.SetFocus
End With




End Sub][/CODE]
 

Discussions similaires

Statistiques des forums

Discussions
314 053
Messages
2 105 101
Membres
109 264
dernier inscrit
lejulpat