Modifier une ligne dans une feuille de clacul via userform vba
Résolu
lanetmel
Messages postés
200
Date d'inscription
Statut
Membre
Dernière intervention
-
Nouvelle -
Nouvelle -
A voir également:
- Excel vba création de formulaire userform ajouter rechercher modifier facilement
- Whatsapp formulaire opposition - Guide
- Modifier liste déroulante excel - Guide
- Modifier dns - Guide
- Formulaire de réclamation facebook - Guide
- Rechercher ou entrer l'adresse - Guide
3 réponses
Voici la solution pour ceux que ça pourrait intéresser :
Private Sub Cmd_modifieretenregistrer_Click()
Dim lig As Integer
With Sheets("BABV") ' feuille ou sont mes infos d'avance
lig = .Columns("A").Find(What:=Tbox_bonachat, after:=Range("A2"), Lookat:=xlWhole).Row ' chercher dans la colonne a , mon élément de référence
.Cells(lig, "B") = Tbox_date ' va porter les infos sur la bonne ligne
.Cells(lig, "C") = Cbox_adressefournisseur
.Cells(lig, "D") = Tbox_détail
.Cells(lig, "E") = Tbox_daterequise
.Cells(lig, "F") = Cbox_termepaiement
.Cells(lig, "G") = Cbox_transport
.Cells(lig, "H") = CheckBox_fab
.Cells(lig, "I") = Cbox_adresselivraison
.Cells(lig, "J") = Label20
.Cells(lig, "L") = Tbox_description1
.Cells(lig, "M") = Tbox_quantité1
.Cells(lig, "N") = Tbox_prixmpmp1
.Cells(lig, "O") = Tbox_description2
.Cells(lig, "P") = Tbox_quantité2
.Cells(lig, "Q") = Tbox_prixmpmp2
.Cells(lig, "R") = Tbox_description3
.Cells(lig, "S") = Tbox_quantité3
.Cells(lig, "T") = Tbox_prixmpmp3
.Cells(lig, "U") = Tbox_description4
.Cells(lig, "V") = Tbox_quantité4
.Cells(lig, "W") = Tbox_prixmpmp4
.Cells(lig, "X") = Tbox_description5
.Cells(lig, "Y") = Tbox_quantité5
.Cells(lig, "Z") = Tbox_prixmpmp5
.Cells(lig, "AA") = Tbox_description6
.Cells(lig, "AB") = Tbox_quantité6
.Cells(lig, "AC") = Tbox_prixmpmp6
.Cells(lig, "AD") = Tbox_description7
.Cells(lig, "AE") = Tbox_quantité7
.Cells(lig, "AF") = Tbox_prixmpmp7
.Cells(lig, "AG") = CheckBox_cad
.Cells(lig, "AH") = CheckBox_usd
.Cells(lig, "AI") = Cbox_acheteur
.Cells(lig, "K") = Tbox_commentaires
End With
Unload Me
End Sub
Private Sub Cmd_modifieretenregistrer_Click()
Dim lig As Integer
With Sheets("BABV") ' feuille ou sont mes infos d'avance
lig = .Columns("A").Find(What:=Tbox_bonachat, after:=Range("A2"), Lookat:=xlWhole).Row ' chercher dans la colonne a , mon élément de référence
.Cells(lig, "B") = Tbox_date ' va porter les infos sur la bonne ligne
.Cells(lig, "C") = Cbox_adressefournisseur
.Cells(lig, "D") = Tbox_détail
.Cells(lig, "E") = Tbox_daterequise
.Cells(lig, "F") = Cbox_termepaiement
.Cells(lig, "G") = Cbox_transport
.Cells(lig, "H") = CheckBox_fab
.Cells(lig, "I") = Cbox_adresselivraison
.Cells(lig, "J") = Label20
.Cells(lig, "L") = Tbox_description1
.Cells(lig, "M") = Tbox_quantité1
.Cells(lig, "N") = Tbox_prixmpmp1
.Cells(lig, "O") = Tbox_description2
.Cells(lig, "P") = Tbox_quantité2
.Cells(lig, "Q") = Tbox_prixmpmp2
.Cells(lig, "R") = Tbox_description3
.Cells(lig, "S") = Tbox_quantité3
.Cells(lig, "T") = Tbox_prixmpmp3
.Cells(lig, "U") = Tbox_description4
.Cells(lig, "V") = Tbox_quantité4
.Cells(lig, "W") = Tbox_prixmpmp4
.Cells(lig, "X") = Tbox_description5
.Cells(lig, "Y") = Tbox_quantité5
.Cells(lig, "Z") = Tbox_prixmpmp5
.Cells(lig, "AA") = Tbox_description6
.Cells(lig, "AB") = Tbox_quantité6
.Cells(lig, "AC") = Tbox_prixmpmp6
.Cells(lig, "AD") = Tbox_description7
.Cells(lig, "AE") = Tbox_quantité7
.Cells(lig, "AF") = Tbox_prixmpmp7
.Cells(lig, "AG") = CheckBox_cad
.Cells(lig, "AH") = CheckBox_usd
.Cells(lig, "AI") = Cbox_acheteur
.Cells(lig, "K") = Tbox_commentaires
End With
Unload Me
End Sub
Merci