bonjour tous le monde
voila je veux changé ma programmation de la macro pour quelle puisse prendre en charge une chaine de caractères au lieu d'un seul mot voila la macro :
Option Explicit
Private Sub CommandButton2_Click()
Feuil1.Activate
Unload Me
End Sub
Private Sub AfficheListe_Click()
Dim WS As Worksheet
Dim Plage As Range, Cell As Range
Dim Recherche As String, Adresse As String
Dim Ligne As Variant
Dim C As Object
Recherche = TextBox1
If Recherche = "" Then Exit Sub
For Each WS In Worksheets
Ligne = Worksheets(WS.Name).Range("" & "B" & "65536").End(xlUp).Row
Set Plage = Worksheets(WS.Name).Range("" & "B" & "2:" & "E" & Ligne)
With Plage
Set C = .Find(Recherche)
If Not C Is Nothing Then
Adresse = C.Address
Do
ListBox1.AddItem C
ListBox2.AddItem C.Address
ListBox3.AddItem WS.Name
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> Adresse
End If
End With
Next WS
End Sub
Private Sub Label2_Click()
End Sub
Private Sub ListBox1_Click()
Dim i As Byte
Dim Feuille As String, Cellule As String
For i = 0 To ListBox1.ListCount
If ListBox1.Selected(i) = True Then
Cellule = ListBox2.List(i)
Feuille = ListBox3.List(i)
End If
Next i
Sheets(Feuille).Activate
Range(Cellule).Select
End Sub
Private Sub UserForm_Click()
End Sub
merci d'avance pour votre aide
cordialement