Afficher les informations dans un textbox provenant de feuille differentes

Bonsoir,

J'essaie d'améliorer un tableau que j'ai fait l'année passée, en sollicitant de temps en temps votre aide, qui m'a été très bénéfique, mais je n' arrive pas à trouver la formule qui va bien.

Dans mon userform, je fais apparaitre dans les textbox les informations de ma feuille "MEMO" jusque là, ça fonctionne, mais quand je veux rajouter les informations de ma feuille "INSCRIPTIONS" ça ne veut plus.

Voici les codes que j'utilise (celui-ci fonctionne)

Private Sub cbnRECHERCHER_Click()

Dim i%,dl%

Dim ws=Sheets("MEMO")

dl=ws.Range("A"&Rows.Count).End(xlUp).Row

For i=2 To dl

If me.txtNOM.Value & Me.txtPRENOM.Value=ws.Cells(i,2).Value & ws.Cells(i,3).Value Then

Me.txtDATE_DE_NAISSANCE=ws.Cells(i,5).Value

Me.txtAGE=ws.Cells(i,6).Value

Me.txtADRESSE=ws.Cells(i,8).Value

Me.txtVILLE=ws.Cells(i,9).Value

End if

Next i

End sub

Je voudrais rajouter ça de la feuille " INSCRIPTIONS"

Me.txtRESTE_A_REGLER=ws.Cells(i,3).Value

Me.REMISE=ws.Cells(i,4).Value

Me.txtPAIEMENT=ws.Cells(i,5).Value

En vous remerciant, pour le temps que vous nous consacré

Bonjour,

Private Sub cbnRECHERCHER_Click()
Dim i%, dl%, WsM, WsI
   Set WsM = Sheets("MEMO")
   Set WsI = Sheets("INSCRIPTIONS")
   With WsM
      dl = .Range("A" & Rows.Count).End(xlUp).Row
      For i = 2 To dl
         If Me.txtNOM.Value & Me.txtPRENOM.Value = .Cells(i, 2).Value & .Cells(i, 3).Value Then
            Me.txtDATE_DE_NAISSANCE = .Cells(i, 5).Value
            Me.txtAGE = .Cells(i, 6).Value
            Me.txtADRESSE = .Cells(i, 8).Value
            Me.txtVILLE = .Cells(i, 9).Value
         End If
      Next i
   End With
   With WsI
      Me.txtRESTE_A_REGLER = .Cells(i, 3).Value
      Me.REMISE = .Cells(i, 4).Value
      Me.txtPAIEMENT = .Cells(i, 5).Value
   End With
End Sub

A+

Bonjour,

j'ai essayé ta formule, mais les informations ne s'affiche toujours pas dans les textbox correspondante

Bonjour,

Je vous joins le fichier test pièce jointe

en vous remerciant

Bonsoir,

En voyant ton fichier ç'est tout de suite plus parlant.

Le code corrigé pour le bouton Recherche :

Private Sub cbnRECHERCHER_Click()
    Dim i%, dl%, WsM, WsI
        Set WsM = Sheets("MEMO") 'Feuille MEMO
        Set WsI = Sheets("INSCRIPTIONS") 'Feuille INSCRIPTIONS
                                        'Feuille CLASSEMENT
    With WsM
        dl = .Range("A" & .Rows.Count).End(xlUp).Row
        For i = 2 To dl
            If Me.txtNOM.Value & Me.txtPRENOM.Value = .Cells(i, 2).Value & .Cells(i, 3).Value Then
               Me.cbbCIVILITE = .Cells(i, 1).Value
               Me.txtN°_FFSB = .Cells(i, 12).Value
               Me.txtN°_FSGT = .Cells(i, 13).Value
               Me.txtDATE_DE_NAISSANCE = .Cells(i, 4).Value
               Me.txtACTIVITE = .Cells(i, 5).Value
               Me.txtAGE = .Cells(i, 6).Value
               Me.txtIMMEUBLE = .Cells(i, 7).Value
               Me.txtADRESSE = .Cells(i, 8).Value
               Me.cbbVILLE = .Cells(i, 9).Value
               Me.txtTELEPHONE = .Cells(i, 10).Value
               txtTELEPHONE = Format(txtTELEPHONE, "00 00 00 00 00")
               Me.txtCOURRIEL = .Cells(i, 11).Value
               Exit For
            End If
            Next i
        End With
        With WsI
        For i = 2 To dl
            If Me.txtNOM.Value & Me.txtPRENOM.Value = .Cells(i, 2).Value & .Cells(i, 3).Value Then
            'Me.cbbCIVILITE = .Cells(i, 1).Value
            Me.txtRESTE_A_REGLER = .Cells(i, 3).Value
            Me.txtCARTE_MEMBRE = .Cells(i, 4).Value
            Me.txtCARTE_CONJOINT = .Cells(i, 5).Value
            Me.txtCARTE_MEMBRE_CONJOINT = .Cells(i, 6).Value
            Me.txtLICENCE_FFSB = .Cells(i, 7).Value
            Me.txtLICENCE_FSGT = .Cells(i, 8).Value
            Me.txtPACK_TENUES = .Cells(i, 9).Value
            Me.txtTOTAL = .Cells(i, 10).Value
            Me.txt1PAIEMENT = .Cells(i, 11).Value
            Me.cbb1PAIEMENT = .Cells(i, 12).Value
            Me.txt2PAIEMENT = .Cells(i, 13).Value
            Me.cbb2PAIEMENT = .Cells(i, 14).Value
            Me.txt3PAIEMENT = .Cells(i, 15).Value
            Me.cbb3PAIEMENT = .Cells(i, 16).Value
            Me.txtCOMPLEMENT = .Cells(i, 17).Value
            Me.cbbCOMPLEMENT = .Cells(i, 18).Value
            Me.txtREMISE_LICENCE_FFSB = .Cells(i, 19).Value
            Me.txtREMISE_LICENCE_FSGT = .Cells(i, 20).Value
            Me.txtAUTRES_REMISES = .Cells(i, 21).Value
            Me.cbbCERTIFICAT_MEDICAL = .Cells(i, 22).Value
            Exit For
               Exit For
            End If
         Next i
       End With
End Sub

ATTENTION : il faut supprimer la première ligne vide dans la feuille MEMO !

En relisant les sujets précédents j'ai vu que tu parlais de 64 bits. Cette information mérite d'être vérifié et confirmée : Habituellement C'est Office ou 265 qui sont 64 bits mais Excel lui est toujours en 32 bits...

Celle information se trouve dans le menu d'Excel Fichier > Compte > A propos d'Excel puis en cliquant sur le point d'interrogation.

ver2016 copie

L'information qui nous intéresse se trouve à la fin de la première ligne :

ver2016b

Donc il est souhaitable que tu précises dans ton profil si ton Excel est vraiment en 32 ou en 64 bits.
Libeller ton information de compte comme suit :

365 + XL 32 bits ou

365 + XL 64 bits

A+

J'ai regardé, et je suis en excel 365, 32 bits.

Merci pour cette information

Ca ne fonctionne pas.

Bonjour benoit,

Regarde si cela te convient

14club-bouliste.xlsm (53.50 Ko)

Comme vous me l'avez demandé, j'ai enlevé la première ligne vide de la feuille "MEMO", j'ai aussi recopié la formule, mais ça ne fonctionne toujours pas.

D'autant que par la suite, je voudrais faire la même chose avec le Classement.

Merci

Galopin1, merci beaucoup, ça fonctionne, il a juste fallu que je réfléchisse un peu pourquoi ca ne voulait pas faire ce que je voulais, il fallait tout simplement mettre les bonne lignes, on ne peu pas rechercher du vide. Merci encore pour ton aide.

Merci Joco7915.

Juste une dernière question, si je veux rajouter encore une feuille, il faut que je la renomme WsC pour CLASSEMENT, c'est bien ça?

Rechercher des sujets similaires à "afficher informations textbox provenant feuille differentes"