|
本帖最后由 3190496160 于 2022-12-6 17:08 编辑
Private Sub TextBox1_Change()
zf = TextBox1.Text
n2 = 0
ReDim br(1 To 1000, 1 To 1)
For i = 1 To n
If InStr(arr(i, 1), zf) > 0 Then
m = m + 1
br(m, 1) = arr(i, 1)
End If
Next i
If m <> "" Then
With ListBox1
.Clear
.List = br
End With
Else
MsgBox "没有了": Exit Sub
End If
End Sub
Private Sub TextBox2_Change()
zf1 = TextBox1.Text
zf2 = TextBox2.Text
ReDim br(1 To 1000, 1 To 1)
For i = 1 To n
If InStr(arr(i, 1), zf1) > 0 And InStr(arr(i, 1), zf2) > 0 Then
m = m + 1
br(m, 1) = arr(i, 1)
End If
Next i
If m <> "" Then
With ListBox1
.Clear
.List = br
End With
Else
MsgBox "没有了": Exit Sub
End If
End Sub
Private Sub TextBox3_Change()
zf1 = TextBox1.Text
zf2 = TextBox2.Text
zf3 = TextBox3.Text
ReDim br(1 To 1000, 1 To 1)
For i = 1 To n
If InStr(arr(i, 1), zf1) > 0 And InStr(arr(i, 1), zf2) > 0 And InStr(arr(i, 1), zf3) > 0 Then
m = m + 1
br(m, 1) = arr(i, 1)
End If
Next i
If m <> "" Then
With ListBox1
.Clear
.List = br
End With
Else
MsgBox "没有了": Exit Sub
End If
End Sub
Private Sub TextBox4_Change()
zf1 = TextBox1.Text
zf2 = TextBox2.Text
zf3 = TextBox3.Text
zf4 = TextBox4.Text
ReDim br(1 To 1000, 1 To 1)
For i = 1 To n
If InStr(arr(i, 1), zf1) > 0 And InStr(arr(i, 1), zf2) > 0 And InStr(arr(i, 1), zf3) > 0 And InStr(arr(i, 1), zf4) > 0 Then
m = m + 1
br(m, 1) = arr(i, 1)
End If
Next i
If m <> "" Then
With ListBox1
.Clear
.List = br
End With
Else
MsgBox "没有了": Exit Sub
End If
End Sub
Private Sub TextBox5_Change()
zf1 = TextBox1.Text
zf2 = TextBox2.Text
zf3 = TextBox3.Text
zf4 = TextBox4.Text
zf5 = TextBox5.Text
ReDim brr(1 To 1000, 1 To 1)
For i = 1 To n
If InStr(arr(i, 1), zf1) > 0 And InStr(arr(i, 1), zf2) > 0 And InStr(arr(i, 1), zf3) > 0 And InStr(arr(i, 1), zf4) > 0 And InStr(arr(i, 1), zf5) > 0 Then
k = k + 1
br(k, 1) = arr(i, 1)
End If
Next i
If k <> "" Then
With ListBox1
.Clear
.List = br
End With
Else
MsgBox "没有了": Exit Sub
End If
End Sub
Private Sub UserForm_Initialize()
lj = ThisWorkbook.Path & "\fenxi\"
n = 0
ReDim arr(1 To 1000, 1 To 1)
f = Dir(lj & "*.xls*")
Do While f <> ""
n = n + 1
arr(n, 1) = f
f = Dir
Loop
With ListBox1
.Clear
.List = arr
End With
End Sub
|
评分
-
1
查看全部评分
-
|