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

¥i¥H§Q¥ÎVBA¶i¦æ¦h±ø¥ó¿z¿ï¶Ü?

¦^´_ 3# GBKEE


    µo²{³o¬O´X¦~«eªº©«¤l¤F¡C´«°Ý°Ýª©¥D¡C
a = Test5.TextBox1.Text
b = Test5.ComboBox1.Value
c = Test5.ComboBox2.Value
d = Test5.ComboBox3.Value¡C¤j¤j½Ð°Ýtest5¡C³o­Ó¦a¤è¬O«ç»ò³]­pªº¡C¤p§ÌÅv­­¤£¨¬¤£¯à¤U¸ü¨Ó¬Ý¡C©êºp

TOP

¦^´_ 4# Jared


   a = Test5.TextBox1.Text
b = Test5.ComboBox1.Value
c = Test5.ComboBox2.Value
d = Test5.ComboBox3.Value¡C¤j¤j½Ð°Ýtest5¡C³o­Ó¦a¤è¬O«ç»ò³]­pªº¡C¤p§ÌÅv­­¤£¨¬¤£¯à¤U¸ü¨Ó¬Ý¡C©êºp

TOP

ÁÂÁ¤À¨É¡C

TOP

¦^´_ 5# jeffrey628litw


§A¥i¥H§â¼Ó³»°ÝÃDªº´ú¸ÕÀɤU¸ü¤U¨Ó
¦b§âµ{¦¡½X´À´«±¼´N¥i¥H¤F
¤¶­±¤WÀ³¸Ó¬O¨S¤°»ò§ï¨ì
¥u¦³¦bµ{¦¡½Xªº³¡¤À
Jared

TOP

2¦ì¤j¤j¡A¤p§Ì­è¦b¾Ç²ßVBA¡A¥i¥H±N±z­Ì°Q½×ªºµ²ªG¡AÀɮפW¶Ç¨Ñ§Ú­Ì¤U¸ü¶Ü?·P®¦

TOP

¦^´_ 3# GBKEE


·PÁ¤j¤j¸Ñ°£¤F§ÚªººÃ´b
­ì¥»ªºµ{¦¡½X¬O¼g¦¨¿W¥ß¦¡
  1. If a <> "" Then
  2. ActiveSheet.Range("$A$1:$E$12").AutoFilter Field:=1, Criteria1:=a: Exit Sub
  3. End If
½Æ»s¥N½X
«á¨Ó¦³­×§ï¦¨
  1. Private Sub CommandButton4_Click()
  2. Dim a, b, c, d, e
  3. a = Test5.TextBox1.Text
  4. b = Test5.ComboBox1.Value
  5. c = Test5.ComboBox2.Value
  6. d = Test5.ComboBox3.Value
  7. e = Test5.TextBox2.Text

  8. If a <> "" Or b <> "" Or c <> "" Or d <> "" Or e <> "" Then
  9. With Sheet2.Range("$A$1:$E$12")
  10. .AutoFilter Field:=1, Criteria1:=a
  11. .AutoFilter Field:=2, Criteria1:=b
  12. .AutoFilter Field:=3, Criteria1:=c
  13. .AutoFilter Field:=4, Criteria1:=d
  14. .AutoFilter Field:=5, Criteria1:=e

  15. End With
  16. End If
  17. End Sub
½Æ»s¥N½X
¦ý«oÅܦ¨­n¨C­Ó±ø¥ó³£²Å¦X¤~·|¿z¿ï¥XªF¦è>"<
¬Ý¤F¤j¤jªº¸Ñµª
­ì¨Ó¬O­n¤À¶}¶i¦æ

¬Ý¨Ó§Ú¤S¾Ç¨ì¤@½Ò¤F^¤f^
«D±`·PÁ¡I¡I
Jared

TOP

¦^´_ 2# Jared
  1. Option Explicit
  2. Private Sub CommandButton4_Click() '¿z¿ï±ø¥ó
  3. Dim a, b, c, d, e
  4. a = Test5.TextBox1.Text
  5. b = Test5.ComboBox1.Value
  6. c = Test5.ComboBox2.Value
  7. d = Test5.ComboBox3.Value
  8. e = Test5.TextBox2.Text
  9. With ActiveSheet.Range("$A$1:$E$12")
  10.     .Parent.AutoFilterMode = False   'Åã¥Ü¥þ³¡¸ê®Æ ->·sªº ¦h­«¿z¿ï ¤~·|½T.
  11.     '¦h­«¿z¿ï  ..........
  12.     If a <> "" Then .AutoFilter Field:=1, Criteria1:=a
  13.     If b <> "" Then .AutoFilter Field:=2, Criteria1:=b
  14.     If c <> "" Then .AutoFilter Field:=3, Criteria1:=c
  15.     If d <> "" Then .AutoFilter Field:=4, Criteria1:=d
  16.     If e <> "" Then .AutoFilter Field:=5, Criteria1:=e
  17.     '¦h­«¿z¿ï  ..........
  18. End With
  19. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 1# Jared


µo²{§Q¥Î³°»s¥¨¶°ªº¤è¦¡
¥i¥H¤@¦¸¿z¿ï¤@­Ó±ø¥ó
¨º¦pªG¬O­n¨â­Ó¥H¤W
­n«ç»ò³]©w©O?
  1. Private Sub CommandButton4_Click() '¿z¿ï±ø¥ó
  2. Dim a, b, c, d, e
  3. a = Test5.TextBox1.Text
  4. b = Test5.ComboBox1.Value
  5. c = Test5.ComboBox2.Value
  6. d = Test5.ComboBox3.Value
  7. e = Test5.TextBox2.Text
  8. If a <> "" Then
  9. ActiveSheet.Range("$A$1:$E$12").AutoFilter Field:=1, Criteria1:=a: Exit Sub
  10. End If

  11. If b <> "" Then
  12. ActiveSheet.Range("$A$1:$E$12").AutoFilter Field:=2, Criteria1:=b: Exit Sub
  13. End If

  14. If c <> "" Then
  15. ActiveSheet.Range("$A$1:$E$12").AutoFilter Field:=3, Criteria1:=c: Exit Sub
  16. End If

  17. If d <> "" Then
  18. ActiveSheet.Range("$A$1:$E$12").AutoFilter Field:=4, Criteria1:=d: Exit Sub
  19. End If

  20. If e <> "" Then
  21. ActiveSheet.Range("$A$1:$E$12").AutoFilter Field:=5, Criteria1:=e: Exit Sub
  22. End If
  23. End Sub
½Æ»s¥N½X
Jared

TOP

        ÀR«ä¦Û¦b : ¥@¤W¦³¨â¥ó¨Æ¤£¯àµ¥¡G¤@¡B§µ¶¶ ¤G¡B¦æµ½¡C
ªð¦^¦Cªí ¤W¤@¥DÃD