Bonsoir le Forum,
J'ai beau chercher sur le forum, mais je n'arrive pas à trouver la solution à mon problème
J'ai un USF qui fait une recherche sur ma feuille entière,
J'aimerais quel fasse sa recherche uniquement de la cellule D4 à EK43
Mon code
Option Explicit
Option Compare Text
Private Sub TextBox1_Change()
Dim R As Range
With ListBox1
.Clear
If TextBox1 = "" Then Exit Sub
For Each R In Cells.SpecialCells(xlCellTypeConstants)
If R Like "*" & TextBox1 & "*" Then
.AddItem R
.List(.ListCount - 1, 1) = R.Address
End If
Next
If .ListCount = 0 Then
MsgBox "pas de trace", vbInformation, "Saisie annulée..."
TextBox1 = ""
End If
End With
End Sub
Private Sub CommandButton2_Click()
Dim i As Byte
With ListBox1
If .ListCount > 0 Then
For i = 0 To .ListCount - 1
If .Selected(i) = True Then Range(.List(i, 1)).Select: Exit For
Next
End If
End With
Unload Me
End Sub
Private Sub ListBox1_Click()
Range(ListBox1.List(ListBox1.ListIndex, 1)).Select
End Sub
Merci beaucoup de votre aide.
Marcelio
J'ai beau chercher sur le forum, mais je n'arrive pas à trouver la solution à mon problème
J'ai un USF qui fait une recherche sur ma feuille entière,
J'aimerais quel fasse sa recherche uniquement de la cellule D4 à EK43
Mon code
Option Explicit
Option Compare Text
Private Sub TextBox1_Change()
Dim R As Range
With ListBox1
.Clear
If TextBox1 = "" Then Exit Sub
For Each R In Cells.SpecialCells(xlCellTypeConstants)
If R Like "*" & TextBox1 & "*" Then
.AddItem R
.List(.ListCount - 1, 1) = R.Address
End If
Next
If .ListCount = 0 Then
MsgBox "pas de trace", vbInformation, "Saisie annulée..."
TextBox1 = ""
End If
End With
End Sub
Private Sub CommandButton2_Click()
Dim i As Byte
With ListBox1
If .ListCount > 0 Then
For i = 0 To .ListCount - 1
If .Selected(i) = True Then Range(.List(i, 1)).Select: Exit For
Next
End If
End With
Unload Me
End Sub
Private Sub ListBox1_Click()
Range(ListBox1.List(ListBox1.ListIndex, 1)).Select
End Sub
Merci beaucoup de votre aide.
Marcelio