bonjour
j'ai trouvé sur un site un code pour userforme qui permet de recherche un mot dans le classeur et quand je clisque sur le mot trouve il me renvoi a la ligne
il fonctionne bien mais j'aimerai qu'il recherche uniquement dans 1 seul feuille et non le classeur :
Dim F As Worksheet
Dim Plage As Range, C As Range
Dim T As String, Firstaddress As String
Dim x As Integer
ListBox1.Clear
T = Me.TextBox1
If T = "" Then Exit Sub
For Each F In Worksheets
With F
Set Plage = Application.Intersect(.UsedRange.Cells, .Range(.Cells(8, 1), .Cells(.Rows.Count, .Columns.Count)))
End With
Set C = Plage.Find(T, LookIn:=xlValues, LookAt:=xlPart)
If Not C Is Nothing Then
Firstaddress = C.Address
Do
With ListBox1
.AddItem F.Name
For x = 2 To 6
.List(.ListCount - 1, x - 1) = F.Cells(C.Row, x).Text
Next x
.List(.ListCount - 1, 6) = C.Address(False, False)
End With
Set C = Plage.FindNext(C)
Loop While Not C Is Nothing And C.Address <> Firstaddress
End If
Next F
If ListBox1.ListCount = 0 Then
MsgBox "Le Texte " & T & " n'a pas été trouvé" & vbLf & "Faites un essai sur une partie du nom", vbCritical, Sign
End If
merci par avance
bonne journée