W
WyLLoU
Guest
Hello,bon j'explique.je voudrais rechercher dans une colonne nom,le nom d'un gars et afficher toute la ligne associé au nom que j'aurais choisi;j'ai fait ça par ADO mais je sais pas comment récupérer les infos.
Private Sub CommandButton1_Click()
Dim rep As Range
Dim maplage As Range
Dim derlgn, R As Integer
Dim Nom As String
Nom = InputBox('Saisie du Nom', 'Operation')
If Nom = '' Then Exit Sub
With Worksheets('Global')
derlgn = .Range('A200').End(xlUp).Row
Set maplage = .Range('A2:A' & derlgn)
Set rep = maplage.Find(Nom, .Range('A2'), , xlWhole)
If Not rep Is Nothing Then
R = rep.Row
MsgBox 'Voilà le résultat ' & Chr(13) & Nom & Chr(13) & ' ' & 'Prénom ' & .Cells(R, 2) _
& Chr(13) & ' ' & 'ref1 ' & .Cells(R, 3) & Chr(13) & ' ' & 'ref2 ' & .Cells(R, 4)
Else
MsgBox 'Personne du Nom de: ' & Nom
End If
End With
End Sub