Re : Bouton supprimer et modifier
Est il possible d'adapter les bouton a ce code car j'ai une dizaine de userform auxquel je devrait rajouter ces 2 boutons.
D'ailleurs mes codes vous semble t il correcte ou ils sont un peut tiré par les cheveux car j'ai tout creer au fur à mesur en lisant des forum et je me suis à chaque fois adapté donc j'espère que c'est à peu prés cohérent et que je pourrez continuer avec ca
POUR ANNULER
Code :
Private Sub cmdAnnulepartenaire_Click()
Unload Me
End Sub
POUR VALIDER UNE CREATION
Code :
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
LISTE DANS LAQUELLE ON SELECTIONNE LA LIGNE
Code :
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