Hi I have this code for a wildcard search,
But It seems not to work, any suggestions?
Also a * Must be entered to run this sub that's why it has
Code:
Sub wildcardsearch()
Dim Found As Boolean
Dim FoundCell As Range
Dim FirstAddx As String
Dim num As String
Dim SearchCount As Integer
Dim wks As Worksheet
Dim search As String
search = Replace(TextBox1.Text, "*", "")
For Each wks In Worksheets
Select Case wks.Name
Case "Cross-ref" 'change/add as desired"
Set FoundCell = wks.Cells.Find(what:=Me.TextBox1.Value, LookIn:=xlValues, Lookat:=xlPart, MatchCase:=False)
If Not FoundCell Is Nothing Then
Found = True
FirstAddx = FoundCell.Address
Do
' wks.Activate
'FoundCell.Select
With Wildcard.Results_wc
.AddItem (FoundCell)
End With
Set FoundCell = wks.Cells.FindNext(After:=FoundCell)
If FoundCell Is Nothing Then Exit Do
If FoundCell.Address = FirstAddx Then Exit Do
Wildcard.Show
Loop
End If
End Select
Next wks
If Not Found Then
MsgBox ("Value Not Found")
End If
End Sub
Also a * Must be entered to run this sub that's why it has
Code:
search = Replace(TextBox1.Text, "*", "")