- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-9-4 10:36 ½s¿è
¦^´_ 18# sillykin - Option Explicit
- Option Base 1 '<- ¤UȬ° 1 ; Yn³]¤UȬ° 0¡A«h Option Base ³¯z¦¡¬O¤£»Ýnªº¡C
- Dim Ar(), Ax() '³o¼Ò²Õ¤¤ªºµ{¦¡¥i¥Î¤§ÅܼÆ
- Private Sub UserForm_Initialize()
- Dim D(1 To 6) As Object, i As Integer, R As Variant
- '********¦pªGSHEET1Äæ¦ìȬ°A~DÄæ¦ì¤ÎFÄæ¦ì¤ÎGÄæ¦ì..***
- Ar = Array(1, 2, 3, 4, 6, 7) '³]©wÄæ¦ì
- '****************************************************
- Ax = Array(ComboBox1, ComboBox2, ComboBox3, ComboBox4, ComboBox5, ComboBox6) 'ComboBox¤»Ó¿ï¶µ¤º®e¨Ì§Ç¬° ²Õ§O,©m¦W1....
- With Sheet1
- .AutoFilterMode = False 'Åã¥Ü¥þ³¡¸ê®Æ ->·sªº ¦h«¿z¿ï ¤~·|½T.
- For i = 1 To 6
- Set D(i) = CreateObject("Scripting.Dictionary")
- For Each R In .Range("A2", .[A2].End(xlDown))
- '************ Y¹w³]ªº¤UȬ° 0 -> i - 1 *******************************************************
- 'D(i)(R.Offset(, Ar(i - 1) - 1).Value) = "" 'i = 1 ®É Y¹w³]ªº¤UȬ°0 «h»ÝAr(i - 1)-> Ar(0) = 1'*
- '*****************************************************************************************************
- D(i)(R.Offset(, Ar(i) - 1).Value) = ""
- Next
- Ax(i).List = Application.Transpose(D(i).keys)
- Next
- End With
- End Sub
- Private Sub CommandButton1_Click() '¿z¿ï±ø¥ó
- Dim Rng As Range, i As Integer
- Application.ScreenUpdating = False
- Set Rng = ActiveSheet.Range("$A$1:$Q$300")
- Rng.Parent.AutoFilterMode = False 'Åã¥Ü¥þ³¡¸ê®Æ ->·sªº ¦h«¿z¿ï ¤~·|½T.
- For i = 1 To 6 '¦h«¿z¿ï ..........
- '************ Y¹w³]ªº¤UȬ° 0 -> i - 1 *****************************************************
- 'If Ax(i - 1).Value <> "" Then Rng.AutoFilter Field:=Ar(i - 1), Criteria1:=Ax(i - 1).Value & "*" '*
- '***************************************************************************************************
- If Ax(i).Value <> "" Then Rng.AutoFilter Field:=Ar(i), Criteria1:=IIf(i <> 5, Ax(i).Value & "*", Ax(i).Value)
- '¤¸(Føó)¬°¼ÆȤ£¥i¥Î * ¨Ó¿z¿ï
- Next
- Application.ScreenUpdating = True
- End Sub
- Private Sub CommandButton4_Click()
- With ActiveSheet.Range("$A$1:$Q$300") '½d³ò
- .Parent.AutoFilterMode = False 'Åã¥Ü¥þ³¡¸ê®Æ ->¨ú®ø ¦h«¿z¿ï
- End With
- End Sub
½Æ»s¥N½X |
|