Bouton recherche -User form
Résolu/Fermé
r4944
Messages postés
122
Date d'inscription
vendredi 2 octobre 2015
Statut
Membre
Dernière intervention
3 mars 2017
-
14 juil. 2016 à 21:05
r4944 Messages postés 122 Date d'inscription vendredi 2 octobre 2015 Statut Membre Dernière intervention 3 mars 2017 - 15 juil. 2016 à 19:02
r4944 Messages postés 122 Date d'inscription vendredi 2 octobre 2015 Statut Membre Dernière intervention 3 mars 2017 - 15 juil. 2016 à 19:02
A voir également:
- Bouton recherche -User form
- Recherche musique - Guide
- Recherche par image - Guide
- Facebook user - Forum Facebook
- Bouton on off ✓ - Forum Loisirs / Divertissements
- Canal tf1 tnt recherche manuelle - Forum TNT
1 réponse
f894009
Messages postés
16904
Date d'inscription
dimanche 25 novembre 2007
Statut
Membre
Dernière intervention
18 mars 2023
1 678
15 juil. 2016 à 09:40
15 juil. 2016 à 09:40
Bonjour,
code modifie a minima, vous connaissez les colonnes donc pourquoi vous compliquer la vie !!!!
code modifie a minima, vous connaissez les colonnes donc pourquoi vous compliquer la vie !!!!
Private Sub CommandButton6_Click()
Dim FindThis As String
Dim LastColumn, LastRow As Integer
Dim rw, FirstAddress, LastCell, SrchRnge
TextBox1 = ""
TextBox2 = ""
With Worksheets("feuil1")
LastRow = .Range("$C$2").End(xlDown).Row
LastColumn = .Range("$C$2").End(xlToRight).Column
LastCell = .Cells(LastRow, LastColumn).Address
SrchRnge = "$C$4:" & LastCell
FindThis = TextBox8
With .Range(SrchRnge).Cells
rw = .Find(What:=FindThis, After:=.Range("$C$4"), LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False).Row
End With
On Error GoTo notfound
TextBox1 = .Range("C" & rw)
TextBox2 = .Range("D" & rw)
End With
notfound:
If TextBox2 = "" Then
MsgBox ("No Result for " & FindThis)
Else
End If
End Sub
15 juil. 2016 à 15:33
15 juil. 2016 à 15:40
Oui, si dans le code , vous affectez FindThis a la valeur selectionnee dans votre liste de validation ou combobox et modifiez l'appel du code suivant le type de list
15 juil. 2016 à 19:02