|
改为:
Private Sub TextBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim i As Integer
Dim Language As Boolean
Dim myStr As String
Me.ListBox1.Clear
With Me.TextBox1
For i = 1 To Len(.Value)
If Asc(Mid$(.Value, i, 1)) > 255 Or Asc(Mid$(.Value, i, 1)) < 0 Then
Language = True
myStr = myStr & Mid$(.Value, i, 1)
Else
myStr = myStr & LCase(Mid$(.Value, i, 1))
End If
Next
End With
With Sheet2
For i = 2 To .Range("A65536").End(xlUp).Row
If Language = True Then
If InStr(.Cells(i, 1).Value, myStr) Then
Me.ListBox1.AddItem .Cells(i, 1).Value
End If
Else
If InStr(.Cells(i, 2).Value, myStr) Then
Me.ListBox1.AddItem .Cells(i, 1).Value
End If
End If
Next
End With
End Sub
|
评分
-
1
查看全部评分
-
|