XL 2013 probleme sur bouton modifier "enregistrement donnee"

bredeche

XLDnaute Occasionnel
bonjour
je me permet de vous solliciter car j'ai un probleme avec mon bouton modifier ddans mon userform

sur mon tableau recap un bouton modifier ouvre un userform ,je fait le rappel de la fiche a modifier avec mon combobx 5
l'enregistrement des modification ce fait bien mais dnas la fiche correspondante les donnee ne s'enregistre pas cela me mets une erreur
j'ai besoin de votre aide ci dessous mon code et mon fichier

VB:
'APPELE DES DONNEE'

Private Sub Combobox5_Change()
Dim Ligne As Integer
    With ThisWorkbook.Sheets("Recap")
        Ligne = .Columns("B").Find(Me.ComboBox5.Value, .Range("b10"), xlValues).Row
        
                                Me.TextBoxobjet.Value = .Cells(Ligne, "C") 'colone c'
                                Me.ComboBox4.Value = .Cells(Ligne, "y") 'colone y'
                                Me.TextBoxfiche.Value = .Cells(Ligne, "Z") 'colone Z'
                                Me.TextBoxdate.Value = .Cells(Ligne, "AA") 'colone AA'
                                Me.TextBoximputation.Value = .Cells(Ligne, "AB") 'colone AB'
                                Me.TextBoxlocalisation.Value = .Cells(Ligne, "AC") 'colone Ac'
                                Me.ComboBox1.Value = .Cells(Ligne, "AD") 'colone AD'
                                Me.TextBoxannée.Value = .Cells(Ligne, "AE") 'colone AE'
                                Me.CheckBox1.Value = .Cells(Ligne, "AF") 'colone AF'
                                Me.CheckBox2.Value = .Cells(Ligne, "AG") 'colone ag'
                                 Me.CheckBox3.Value = .Cells(Ligne, "AH") 'colone aH'
                                 Me.TextBoxconstat.Value = .Cells(Ligne, "AI") 'colone AI'
                                Me.TextBoxrisque.Value = .Cells(Ligne, "AJ") 'colone AJ'
                                 Me.TextBoxorigine.Value = .Cells(Ligne, "AK") 'colone AK'
                                  Me.TextBoxconservatoires.Value = .Cells(Ligne, "AL") 'colone AL'
                                   Me.TextBoxtravaux.Value = .Cells(Ligne, "AM") 'colone AM'
                                   Me.TextBoxobservation.Value = .Cells(Ligne, "AN") 'colone AN'
                                    Me.TextBoxconstructeur.Value = .Cells(Ligne, "AO") 'colone AO'
                                     Me.TextBoxdureevie1.Value = .Cells(Ligne, "AP") 'colone AP'
                                     Me.TextBoxdureevie2.Value = .Cells(Ligne, "AQ") 'colone AQ'
                                   Me.TextBoximage.Value = .Cells(Ligne, "AR") 'colone AR'
    End With
End Sub


Private Sub CommandButton2_Click()
Dim Ligne As Integer
    With ThisWorkbook.Sheets("Recap")
        Ligne = .Columns("B").Find(Me.ComboBox5.Value, .Range("b10"), xlValues).Row
 
 .Range("C" & Ligne).Value = TextBoxobjet
        .Range("Y" & Ligne).Value = ComboBox4
        .Range("Z" & Ligne).Value = TextBoxfiche
        .Range("AA" & Ligne).Value = CDate(TextBoxdate)
        .Range("AB" & Ligne).Value = TextBoximputation
        .Range("AC" & Ligne).Value = TextBoxlocalisation
        .Range("AD" & Ligne).Value = ComboBox1
        .Range("D" & Ligne).Value = ComboBox1
        .Range("AE" & Ligne).Value = TextBoxannée
        .Range("AF" & Ligne).Value = CheckBox1
        .Range("AG" & Ligne).Value = CheckBox2
        .Range("AH" & Ligne).Value = CheckBox3
        .Range("AI" & Ligne).Value = TextBoxconstat
        .Range("AJ" & Ligne).Value = TextBoxrisque
        .Range("AK" & Ligne).Value = TextBoxorigine
        .Range("AL" & Ligne).Value = TextBoxconservatoires
        .Range("AM" & Ligne).Value = TextBoxtravaux
        .Range("AN" & Ligne).Value = TextBoxobservation
        .Range("AO" & Ligne).Value = TextBoxconstructeur
        .Range("AP" & Ligne).Value = TextBoxdureevie1
        .Range("AQ" & Ligne).Value = TextBoxdureevie2
        .Range("AR" & Ligne).Value = TextBoximage
   End With
            .Name = Worksheets("RECAP").Range("B" & Ligne)
            .Range("B3") = TextBoxobjet
            .Range("A6") = TextBoxfiche
            .Range("B6") = TextBoxdate
            .Range("C6") = TextBoximputation
            .Range("D6") = TextBoxlocalisation
            .Range("E6") = ComboBox1
            .Range("F6") = TextBoxannée
            .Range("G6") = ComboBox4
            .Range("A9") = TextBoxconstat
            .Range("E11") = CheckBox1
            .Range("E12") = CheckBox2
            .Range("E13") = CheckBox3
            .Range("A16") = TextBoxrisque
            .Range("A21") = TextBoxorigine
            .Range("A26") = TextBoxconservatoires
            .Range("A30") = TextBoxtravaux
            .Range("A35") = TextBoxobservation
            .Range("H15") = TextBoxconstructeur
            .Range("K17") = TextBoxdureevie1
            .Range("K18") = TextBoxdureevie2
            .Range("H20") = TextBoximage
   End With
     Unload UserForm3
    
End Sub

   Private Sub Textboxdate_Change()
'Code permettant de mettre une date au format 00/00/0000 dans une textbox
Dim valeur As Byte
TextBoxdate.MaxLength = 10 'nb caractères maxi autorisé dans le textbox
valeur = Len(TextBoxdate)
If valeur = 2 Or valeur = 5 Then TextBoxdate = TextBoxdate & "/"

End Sub

de plus dans mon userform 1 l'insertion de mon image ne se fait pas cela mets que du texte

merci de votre aide
 

Pièces jointes

  • fichier tableau ger.xlsm
    149.6 KB · Affichages: 6

bredeche

XLDnaute Occasionnel
merci de votre aide mais j'ai trouveé

VB:
'APPELE DES DONNEE'

Private Sub ComboBox5_Change()
Dim Ligne As Integer

Cells(ComboBox5.ListIndex + 10, 1).EntireRow.Select 'sélectionne la ligne correspondante
    With ThisWorkbook.Sheets("00-Recap")
        Ligne = .Columns("B").Find(Me.ComboBox5.Value, .Range("b10"), xlValues).Row
        
                                Me.TextBoxobjet.Value = .Cells(Ligne, "C") 'colone c'
                                Me.ComboBox4.Value = .Cells(Ligne, "y") 'colone y'
                                Me.TextBoxfiche.Value = .Cells(Ligne, "Z") 'colone Z'
                                Me.TextBoxdate.Value = .Cells(Ligne, "AA") 'colone AA'
                                Me.TextBoximputation.Value = .Cells(Ligne, "AB") 'colone AB'
                                Me.TextBoxlocalisation.Value = .Cells(Ligne, "AC") 'colone Ac'
                                Me.ComboBox1.Value = .Cells(Ligne, "AD") 'colone AD'
                                Me.TextBoxannée.Value = .Cells(Ligne, "AE") 'colone AE'
                                Me.CheckBox1.Value = .Cells(Ligne, "AF") 'colone AF'
                                Me.CheckBox2.Value = .Cells(Ligne, "AG") 'colone ag'
                                 Me.CheckBox3.Value = .Cells(Ligne, "AH") 'colone aH'
                                 Me.TextBoxconstat.Value = .Cells(Ligne, "AI") 'colone AI'
                                Me.TextBoxrisque.Value = .Cells(Ligne, "AJ") 'colone AJ'
                                 Me.TextBoxorigine.Value = .Cells(Ligne, "AK") 'colone AK'
                                  Me.TextBoxconservatoires.Value = .Cells(Ligne, "AL") 'colone AL'
                                   Me.TextBoxtravaux.Value = .Cells(Ligne, "AM") 'colone AM'
                                   Me.TextBoxobservation.Value = .Cells(Ligne, "AN") 'colone AN'
                                    Me.TextBoxconstructeur.Value = .Cells(Ligne, "AO") 'colone AO'
                                     Me.TextBoxdureevie1.Value = .Cells(Ligne, "AP") 'colone AP'
                                     Me.TextBoxdureevie2.Value = .Cells(Ligne, "AQ") 'colone AQ'
                                   Me.TextBoximage.Value = .Cells(Ligne, "AR") 'colone AR'
    End With
End Sub



Private Sub CommandButton2_Click()
Dim Ligne As Integer
    With ThisWorkbook.Sheets("00-Recap")
        Ligne = .Columns("B").Find(Me.ComboBox5.Value, .Range("b10"), xlValues).Row
 
 .Range("C" & Ligne).Value = TextBoxobjet
        .Range("Y" & Ligne).Value = ComboBox4
        .Range("Z" & Ligne).Value = TextBoxfiche
        .Range("AA" & Ligne).Value = CDate(TextBoxdate)
        .Range("AB" & Ligne).Value = TextBoximputation
        .Range("AC" & Ligne).Value = TextBoxlocalisation
        .Range("AD" & Ligne).Value = ComboBox1
        .Range("D" & Ligne).Value = ComboBox1
        .Range("AE" & Ligne).Value = TextBoxannée
        .Range("AF" & Ligne).Value = CheckBox1
        .Range("AG" & Ligne).Value = CheckBox2
        .Range("AH" & Ligne).Value = CheckBox3
        .Range("AI" & Ligne).Value = TextBoxconstat
        .Range("AJ" & Ligne).Value = TextBoxrisque
        .Range("AK" & Ligne).Value = TextBoxorigine
        .Range("AL" & Ligne).Value = TextBoxconservatoires
        .Range("AM" & Ligne).Value = TextBoxtravaux
        .Range("AN" & Ligne).Value = TextBoxobservation
        .Range("AO" & Ligne).Value = TextBoxconstructeur
        .Range("AP" & Ligne).Value = TextBoxdureevie1
        .Range("AQ" & Ligne).Value = TextBoxdureevie2
        .Range("AR" & Ligne).Value = TextBoximage
   End With
           With Sheets(ComboBox5.Value)
            .Range("B3") = TextBoxobjet
            .Range("A6") = TextBoxfiche
            .Range("B6") = TextBoxdate
            .Range("C6") = TextBoximputation
            .Range("D6") = TextBoxlocalisation
            .Range("E6") = ComboBox1
            .Range("F6") = TextBoxannée
            .Range("G6") = ComboBox4
            .Range("A9") = TextBoxconstat
            .Range("E11") = CheckBox1
            .Range("E12") = CheckBox2
            .Range("E13") = CheckBox3
            .Range("A16") = TextBoxrisque
            .Range("A21") = TextBoxorigine
            .Range("A26") = TextBoxconservatoires
            .Range("A30") = TextBoxtravaux
            .Range("A35") = TextBoxobservation
            .Range("H15") = TextBoxconstructeur
            .Range("K17") = TextBoxdureevie1
            .Range("K18") = TextBoxdureevie2
            .Range("H20") = TextBoximage
   End With
     Unload UserForm3
    
End Sub

   Private Sub Textboxdate_Change()
'Code permettant de mettre une date au format 00/00/0000 dans une textbox
Dim valeur As Byte
TextBoxdate.MaxLength = 10 'nb caractères maxi autorisé dans le textbox
valeur = Len(TextBoxdate)
If valeur = 2 Or valeur = 5 Then TextBoxdate = TextBoxdate & "/"

End Sub
 

Statistiques des forums

Discussions
312 109
Messages
2 085 382
Membres
102 877
dernier inscrit
robinet