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

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

¥»©«³Ì«á¥Ñ 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

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD