Re : Recherche grace à la 1ere colonne
Rebonjour et merci pour le coup de main.
Mais quand je clique sur le bouton pour valider la modif il ne se passe rien (j'ai rennomé le nom du bouton comme ci dessus mais rien).
N'y aurait il pas une erreur sur le code ?, j'ai essaié avec unload me à la fin mais ca ferme l'userform sans enregistré
Voici l'enssemble de mon code sur cette userform
Merci beaucoup!!😀
Private Sub cmdAnnulepartenaire_Click()
Unload Me
End Sub
Private Sub CmdEditer_Click()
'Mode édition
Dim c As Range
On Error GoTo erreur
Set c = Sheets("Partenaire").Columns(1).Find(ComboBoxmodifpartenaire, LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then GoTo erreur
With c
.Cells(1, 0) = txtorganisme
.Cells(1, 1) = ComboBoxcompetence
.Cells(1, 2) = txtnom
.Cells(1, 3) = txtprenom
.Cells(1, 4) = txttel
.Cells(1, 5) = txtfax
.Cells(1, 6) = txtmail
.Cells(1, 7) = txtadresse
.Cells(1, 8) = txtcodepostal
.Cells(1, 9) = txtville
End With
Exit Sub
erreur:
Beep
End Sub
Private Sub cmdValidepartenaire_Click()
Dim Derli As Byte 'changer le type en fonction du nombre de lignes
With Sheets("Partenaire")
Derli = .[A256].End(xlUp).Row + 1
.Cells(Derli, 1) = txtorganisme
.Cells(Derli, 2) = ComboBoxcompetence
.Cells(Derli, 3) = txtnom
.Cells(Derli, 4) = txtprenom
.Cells(Derli, 5) = txttel
.Cells(Derli, 6) = txtfax
.Cells(Derli, 6) = txtmail
.Cells(Derli, 7) = txtcodepostal
.Cells(Derli, 8) = txtville
Unload Me
End With
End Sub
Private Sub ComboBoxmodifpartenaire_Change()
Set c = Sheets("Partenaire").Columns(1).Find(ComboBoxmodifpartenaire, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
txtorganisme = c.Offset(0, 0)
ComboBoxcompetence = c.Offset(0, 1)
txtnom = c.Offset(0, 2)
txtprenom = c.Offset(0, 3)
txttel = c.Offset(0, 4)
txtfax = c.Offset(0, 5)
txtmail = c.Offset(0, 6)
txtadresse = c.Offset(0, 7)
txtcodepostal = c.Offset(0, 8)
txtville = c.Offset(0, 8)
End If
End Sub