ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¦p¦ó§Q¥Î¤Ä¿ï¤è¶ô¨Ó¿z¿ï¸ê®Æ

¦p¦ó§Q¥Î¤Ä¿ï¤è¶ô¨Ó¿z¿ï¸ê®Æ

·Q½Ð°Ý¦U¦ì¤j¤j
§Ú²{¦b·Q­n§Q¥Îªí³æ¨Ó¿z¿ï¸ê®Æ

¤U©Ô¦¡¿ï¾Ü¸ê®ÆÁÙ¥i¥H°õ¦æ
¦ý¦pªG·Q­n§Q¥Î¤Ä¿ï¸ê®Æªº¤è¦¡
¤£¾å±o°ÝÃDÂI¦b­þ¸Ì ><
´ú¸Õ.zip (18.57 KB)
  1. Dim a, b, c, d, e, f, g, h, i, j, k, l, m
  2. Private Sub CommandButton1_Click() '¿z¿ï±ø¥ó

  3. a = Test.ComboBox1.Value '©u¸`
  4. b = Test.ComboBox2.Value '¤ë¥÷

  5. d = CheckBox1.Value
  6. e = CheckBox2.Value
  7. f = CheckBox3.Value
  8. g = CheckBox4.Value
  9. h = CheckBox5.Value
  10. i = CheckBox6.Value
  11. j = CheckBox7.Value
  12. k = CheckBox8.Value
  13. l = CheckBox9.Value
  14. m = CheckBox10.Value

  15. c = Array(d, e, f, g, h, i, j, k, l, m)


  16. With ActiveSheet.Range("$A$1:$K$121")
  17.     .Parent.AutoFilterMode = False   'Åã¥Ü¥þ³¡¸ê®Æ ->·sªº ¦h­«¿z¿ï
  18.    
  19.     '¦h­«¿z¿ï  ..........
  20.     If a <> "" Then .AutoFilter Field:=1, Criteria1:=a
  21.     If b <> "" Then .AutoFilter Field:=2, Criteria1:=b
  22.     If c <> "" Then .AutoFilter Field:=3, Criteria1:=c, Operator:=xlFilterValues
  23.     '¦h­«¿z¿ï  ..........
  24. End With
  25. End Sub

  26. Private Sub CommandButton2_Click() '²M°£¤º®e
  27. Me.ComboBox1 = ""
  28. Me.ComboBox2 = ""
  29. Me.CheckBox1 = ""
  30. Me.CheckBox2 = ""
  31. Me.CheckBox3 = ""
  32. Me.CheckBox4 = ""
  33. Me.CheckBox5 = ""
  34. Me.CheckBox6 = ""
  35. Me.CheckBox7 = ""
  36. Me.CheckBox8 = ""
  37. Me.CheckBox9 = ""
  38. Me.CheckBox10 = ""
  39. End Sub

  40. Private Sub CommandButton3_Click() '¨ú®ø
  41. Test.Hide
  42. End Sub

  43. Private Sub CommandButton4_Click() '®i¶}
  44. ActiveSheet.Range("$A$1:$K$121").AutoFilter Field:=1
  45. ActiveSheet.Range("$A$1:$K$121").AutoFilter Field:=2
  46. ActiveSheet.Range("$A$1:$K$121").AutoFilter Field:=3
  47. End Sub
  48. Private Sub UserForm_Initialize()

  49.     ComboBox1.List = Array("Q1", "Q2", "Q3", "Q4") '©u
  50.    
  51.     ComboBox2.List = Array("¤@¤ë", "¤G¤ë", "¤T¤ë", "¥|¤ë", "¤­¤ë", "¤»¤ë", "¤C¤ë", "¤K¤ë", "¤E¤ë", "¤Q¤ë", "¤Q¤@¤ë", "¤Q¤G¤ë") '¤ë

  52. End Sub
½Æ»s¥N½X
Jared

¥»©«³Ì«á¥Ñ luhpro ©ó 2015-6-11 23:43 ½s¿è
·Q½Ð°Ý¦U¦ì¤j¤j
§Ú²{¦b·Q­n§Q¥Îªí³æ¨Ó¿z¿ï¸ê®Æ
¤U©Ô¦¡¿ï¾Ü¸ê®ÆÁÙ¥i¥H°õ¦æ
¦ý¦pªG·Q­n§Q¥Î¤Ä¿ï¸ê®Æªº¤è ...
Jared µoªí©ó 2015-6-8 16:44

¬Ý°_¨Ó¦Û°Ê¿z¿ï¦P¤@Äæ¦n¹³¤£¯à¦P®Éº¡¨¬¶W¹L¤@­Ó±ø¥ó. (§Y¤£¯à¦b¦P¤@Ä椤¦P®ÉÅã¥Ü¥X¨Ó¤pµØ»P¤p©ú)

©Ò¥H§Ú³o¸Ì±Ä¥Î³v¦C¿z¿ï,
¥¼¯à¦P®Éº¡¨¬©Ò¦³±ø¥óªº¦C«h±N¨äÁôÂÃ,
¯d¤Uªº´N¬O§Ú­Ì­nªº¸ê®Æ¤F.

¤]¦]¬°±Ä¥Îªº¬OÁôÂæCªº¤è¦¡,
©Ò¥H "«ö¶s1" ¦ì¸m­n¤W²¾¨ì ²Ä 1 ¦C ¥H§K³QÁôÂæӵLªkÂI¿ï.

­º¥ý, ¦]À³µ{¦¡½Õ¾ã, ¥þ°ìÅܼƪº«Å§i¤º®e¤]°µ½Õ¾ã:
  1. Dim a, b, s, lRow
½Æ»s¥N½X
"¿z¿ï±ø¥ó" «ö¶sµ{¦¡­×§ï¦p¤U:
  1. Private Sub CommandButton1_Click() '¿z¿ï±ø¥ó

  2. ActiveSheet.Rows.Hidden = False

  3. a = Test.ComboBox1.Value '©u¸`
  4. b = Test.ComboBox2.Value '¤ë¥÷

  5. s = ""
  6. s = s & IIf(CheckBox1, CheckBox1.Caption & ",", "")
  7. s = s & IIf(CheckBox2, CheckBox2.Caption & ",", "")
  8. s = s & IIf(CheckBox3, CheckBox3.Caption & ",", "")
  9. s = s & IIf(CheckBox4, CheckBox4.Caption & ",", "")
  10. s = s & IIf(CheckBox5, CheckBox5.Caption & ",", "")
  11. s = s & IIf(CheckBox6, CheckBox6.Caption & ",", "")
  12. s = s & IIf(CheckBox7, CheckBox7.Caption & ",", "")
  13. s = s & IIf(CheckBox8, CheckBox8.Caption & ",", "")
  14. s = s & IIf(CheckBox9, CheckBox9.Caption & ",", "")
  15. s = s & IIf(CheckBox10, CheckBox10.Caption & ",", "")

  16. lRow = 2
  17. With ActiveSheet
  18.   While .Cells(lRow, 1) <> ""
  19.     If Not (.Cells(lRow, 1) = a And .Cells(lRow, 2) = b And _
  20.         InStr(1, s, .Cells(lRow, 3)) <> 0) Then .Rows(lRow).Hidden = True
  21.     lRow = lRow + 1
  22.   Wend
  23. End With
  24. End Sub
½Æ»s¥N½X
"²M°£¤º®e" «ö¶sµ{¦¡¤¤,
CheckBox ªº­È¦b¦¹¤£¯à³]¬° "" ¦ÓÀ³³]¬° False ©Î true ,
¥t¥~¬JµM¿z¿ïªº±ø¥ó¤w¸g³Q²M°£¤F,
¿z¿ïµ²ªG¦ÛµMÀ³¸Ó¤@¨Ö°µÁÙ­ì.
¬G­×§ï¦p¤U:
  1. Private Sub CommandButton2_Click() '²M°£¤º®e
  2. Me.ComboBox1 = ""
  3. Me.ComboBox2 = ""
  4. Me.CheckBox1 = False
  5. Me.CheckBox2 = False
  6. Me.CheckBox3 = False
  7. Me.CheckBox4 = False
  8. Me.CheckBox5 = False
  9. Me.CheckBox6 = False
  10. Me.CheckBox7 = False
  11. Me.CheckBox8 = False
  12. Me.CheckBox9 = False
  13. Me.CheckBox10 = False
  14. ActiveSheet.Rows.Hidden = False
  15. End Sub
½Æ»s¥N½X
"®i¶}" «ö¶sµ{¦¡¤]­n¸òµÛ°µ½Õ¾ã:
  1. Private Sub CommandButton4_Click() '®i¶}
  2.   ActiveSheet.Rows.Hidden = False
  3. End Sub
½Æ»s¥N½X
¥t¥~§AªºÀÉ®×  ComboBox2.List ¤º®e¨Ã¤£¯à»P B Äæ¹ïÀ³, (¨Ò¦p : "¤@" ¤£¯à¹ïÀ³ "¤@¤ë"),
¦P®É¥i¥H¦Ò¼{¤@¨Ö³£½á»Pªì­È,
©Ò¥H§Ú°µ¤F¥H¤Uªº­×§ï:
  1. Private Sub UserForm_Initialize()

  2.     With ComboBox1
  3.       .List = Array("Q1", "Q2", "Q3", "Q4") '©u
  4.       .Value = "Q1"
  5.     End With
  6.     With ComboBox2
  7.       .List = Array("¤@", "¤G", "¤T") '¤ë
  8.       .Value = "¤@"
  9.     End With
  10. End Sub
½Æ»s¥N½X
³Ì«á Q1 ¤£·|¦³ "¤@","¤G","¤T" ¥H¥~ªº¤ë¥÷,
¬G¥i¥H¦bÅܧó ComboBox1 ¤º®e®É¤@¨Ö§â ComboBox2 ªº¿ï³æ½Õ¾ã¦n:
  1. Private Sub ComboBox1_Change()
  2.   Select Case ComboBox1
  3.   
  4.     Case "Q1"
  5.       ComboBox2.List = Array("¤@", "¤G", "¤T") '¤ë
  6.    
  7.     Case "Q2"
  8.       ComboBox2.List = Array("¥|", "¤­", "¤»")  '¤ë
  9.    
  10.     Case "Q3"
  11.       ComboBox2.List = Array("¤C", "¤K", "¤E") '¤ë
  12.    
  13.     Case "Q4"
  14.       ComboBox2.List = Array("¤Q", "¤Q¤@", "¤Q¤G")  '¤ë
  15.   End Select
  16.   
  17. End Sub
½Æ»s¥N½X
·íµM, µ{¦¡ÁÙ¦³Â²¤ÆªºªÅ¶¡,
¥B CheckBox ¤]¥i¥H¦Ò¼{°µª«¥ó°}¦C,
¤£¹L¦]¬°µ{¦¡¨Ã¤£½ÆÂø,
©Ò¥H³o³¡¥÷§Ú´N¥ý¤£¦Ò¼{¤F.
´ú¸Õ-a.zip (18.13 KB)

TOP

¦^´_ 2# luhpro


    ÁÂÁ¤j¤j :)
Jared

TOP

        ÀR«ä¦Û¦b : ­n¤ñ½Ö§ó¨ü½Ö¡D¤£­n¤ñ½Ö§ó©È½Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD