- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2022-9-22 15:40 ½s¿è
¤µ¤Ñ²ß±o:¤£¥²n«½Æ©I¥sFunction È
Function()ÁöµM¥i¥H©I¥s¨ì»ÝnªºÈ
¦ý¬O¹B¥Î³o¨ÇȮɻÝn¥t¥Î®e¾¹¸Ë,¤£µM¦b°j°é¸Ì¤@ª½«½Æ©I¥s³o¨ÇÈ,·|¦h¥X«Ü¦h®É¶¡- ³o¬Oì©lµ{¦¡½X,«½Æ©I¥s!°õ¦æ®É¶¡«Üªø
- Private Sub TextBox1_Change()
- Dim Arr, x
- List7.Clear
- List7.Locked = True
- Le = Len(TextBox1.Text)
- If Le < 3 Then
- Exit Sub
- End If
- Set xDic = CreateObject("Scripting.Dictionary")
- Dim NM
- For i = 1 To UBound(Szrr)
- If InStr(Szrr(i, f("¾Þ_¹q¸ÜÄæ")), TextBox1.Text) Then
- NM = Szrr(i, f("¾Þ_¹q¸ÜÄæ"))
- xDic(NM) = ""
- End If
- Next
- If xDic.Count > 1 Then
- NM = ""
- End If
- mNo = 7
- For i = 1 To xDic.Count
- List(mNo).AddItem WorksheetFunction.Index(xDic.keys, i)
- Next
- If xDic.Count > 1 Then
- Arr = Application.Transpose(xDic.keys)
- End If
- Set xDic = Nothing
- With List(mNo)
- .Locked = False
- If .ListCount = 1 Then
- .SetFocus
- .ListIndex = 0
- End If
- End With
- List1.Clear
- List1.Locked = True
- mNo = 1
- Set xDic = CreateObject("Scripting.Dictionary")
- If NM = "" Then
- For i = 1 To UBound(Szrr)
- For x = 1 To UBound(Arr)
- If Szrr(i, f("¾Þ_¹q¸ÜÄæ")) = Arr(x, 1) Then
- xDic(Szrr(i, f("¾Þ_¹}¥DÄæ"))) = ""
- End If
- Next
- Next
- Else
- For i = 1 To UBound(Szrr)
- If Szrr(i, f("¾Þ_¹q¸ÜÄæ")) = NM Then
- xDic(Szrr(i, f("¾Þ_¹}¥DÄæ"))) = ""
- End If
- Next
- End If
- For i = 1 To xDic.Count
- List(mNo).AddItem WorksheetFunction.Index(xDic.keys, i)
- Next
- Set xDic = Nothing
- With List(mNo)
- .Locked = False
- If .ListCount = 1 Then .SetFocus: .ListIndex = 0
- End With
- End Sub
½Æ»s¥N½X- ³o¬O¥ÎJ,k²±¸Ë©I¥sÈ,¥u©I¥s¤@¦¸,®É¶¡¤j´TÁYµu
- Private Sub TextBox1_Change()
- Dim Arr, x, j, k
- j = f("¾Þ_¹q¸ÜÄæ")
- k = f("¾Þ_¹}¥DÄæ")
- List7.Clear
- List7.Locked = True
- Le = Len(TextBox1.Text)
- If Le < 3 Then
- Exit Sub
- End If
- Set xDic = CreateObject("Scripting.Dictionary")
- Dim NM
- For i = 1 To UBound(Szrr)
- If InStr(Szrr(i, j), TextBox1.Text) Then
- NM = Szrr(i, j)
- xDic(NM) = ""
- End If
- Next
- If xDic.Count > 1 Then
- NM = ""
- End If
- mNo = 7
- For i = 1 To xDic.Count
- List(mNo).AddItem WorksheetFunction.Index(xDic.keys, i)
- Next
- If xDic.Count > 1 Then
- Arr = Application.Transpose(xDic.keys)
- End If
- Set xDic = Nothing
- With List(mNo)
- .Locked = False
- If .ListCount = 1 Then
- .SetFocus
- .ListIndex = 0
- End If
- End With
- List1.Clear
- List1.Locked = True
- mNo = 1
- Set xDic = CreateObject("Scripting.Dictionary")
- If NM = "" Then
- For i = 1 To UBound(Szrr)
- For x = 1 To UBound(Arr)
- If Szrr(i, j) = Arr(x, 1) Then
- xDic(Szrr(i, k)) = ""
- End If
- Next
- Next
- Else
- For i = 1 To UBound(Szrr)
- If Szrr(i, j) = NM Then
- xDic(Szrr(i, k)) = ""
- End If
- Next
- End If
- For i = 1 To xDic.Count
- List(mNo).AddItem WorksheetFunction.Index(xDic.keys, i)
- Next
- Set xDic = Nothing
- With List(mNo)
- .Locked = False
- If .ListCount = 1 Then .SetFocus: .ListIndex = 0
- End With
- End Sub
½Æ»s¥N½X |
|