XL 2016 Pouvoir apporter des modifications sur une BD depuis une listbox

dindin

XLDnaute Occasionnel
Bonjour le Forum
j'ai réussi à rajouter une nouvelle entité dans ma base de donnée .
rechercher le nom dans une l'entité
par contre je bloque quand je voulais enregistrer les modifications apportées sur une entité existante
ci joint le fichier .
Merci pour votre aide
 

Pièces jointes

  • bd_Ent.xlsm
    133.3 KB · Affichages: 10

fanch55

XLDnaute Barbatruc
Bonjour,
Ne pas autoriser le changement du n° de l'entreprise et en ce cas ;
VB:
Private Sub CommandButton2_Click()
Dim RowNo As Integer
With ThisWorkbook.Sheets("BDD_Ent_TR")
    Set R = .Cells.Find(TextBox8, lookat:=xlWhole)
    If Not R Is Nothing Then
        RowNo = R.Row
        .Range("B" & RowNo).Value = Me.TextBox9.Value
        .Range("C" & RowNo).Value = Me.TextBox10.Value
        .Range("D" & RowNo).Value = Me.TextBox11.Value
        .Range("E" & RowNo).Value = Me.TextBox12.Value
        .Range("F" & RowNo).Value = Me.TextBox13.Value
       . Range("G" & RowNo).Value = Me.TextBox14.Value
        Set R = Nothing
   End If
End With
End Sub
 

dindin

XLDnaute Occasionnel
Bonjour,
Ne pas autoriser le changement du n° de l'entreprise et en ce cas ;
VB:
Private Sub CommandButton2_Click()
Dim RowNo As Integer
With ThisWorkbook.Sheets("BDD_Ent_TR")
    Set R = .Cells.Find(TextBox8, lookat:=xlWhole)
    If Not R Is Nothing Then
        RowNo = R.Row
        .Range("B" & RowNo).Value = Me.TextBox9.Value
        .Range("C" & RowNo).Value = Me.TextBox10.Value
        .Range("D" & RowNo).Value = Me.TextBox11.Value
        .Range("E" & RowNo).Value = Me.TextBox12.Value
        .Range("F" & RowNo).Value = Me.TextBox13.Value
       . Range("G" & RowNo).Value = Me.TextBox14.Value
        Set R = Nothing
   End If
End With
End Sub
Top merci
 

Discussions similaires

Réponses
21
Affichages
1 K

Statistiques des forums

Discussions
312 582
Messages
2 089 922
Membres
104 307
dernier inscrit
Diet