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

[µo°Ý] ¦p¦ó¤ñ¹ï®É¶¡¡K¡K

[µo°Ý] ¦p¦ó¤ñ¹ï®É¶¡¡K¡K

¥»©«³Ì«á¥Ñ play9091 ©ó 2012-3-21 11:28 ½s¿è

§Ú·Q­n¥Î"¶i¶¥¿z¿ï"¹ï¤@°ï¸ê®Æ°µ¿z¿ï¡C

¦ý²{¦b¹J¨ì¤@­Ó°ÝÃD¡A§Ú·Q­n¹ï¤é´Á°µ¿z¿ï¡C¦ý¬O¤£ª¾¹D«ç»ò¼Ë¤l¥h©M¤é´Á°µ¤ñ¹ï¡K¡K

¨Ò¦p¡G§Ú·Q­n¿z¿ï¤j©ó2012/03/14¡A¦ý¬O¹ê»Ú¿z¿ï¥X¨Ó2012/03/14ÁÙ¬O¦b¿z¿ï«áªº¦Cªí¸Ì­±¡I

§Úªº¼gªk¦p¤U¡G
  1.     D = Date - 7
  2.     Range("S2") = "=D2>" & D
  3.    Range("A1:Q65536").AdvancedFilter Action:=xlFilterInPlace, _
  4.         CriteriaRange:=Range("S1:T2"), Unique:=False
½Æ»s¥N½X
½d¨Ò¦pªþÀÉ¡I·Ð½Ð¥ý¶i­Ì«ü±Ð¤@¤U¡I

½d¨Ò.rar (18.11 KB)

ªì¾ÇVBA¥E¨ìtwbts

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2012-3-21 13:38 ½s¿è

¦^´_ 1# play9091


    ±NPÄæ¦ìªº¤½¦¡§ï¦¨=B2>DATE(2012,3,14)  OR =B2>DATEVALUE("2012/3/14")´N·|¬OFALSE
    =B2>2012/3/14 =>³o­Óªº·N«ä¬O B2=> (2012°£¥H3°£¥H14)
   ­n¦h¤F¸Ñ¤@¤U¤½¦¡ªº²[¸q­ò~
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 2# hugh0620


    ¥ÎVBA¼g¥X¼Ó¤W¥ý¶i¼gªº¤½¦¡¦nÃø³á¡I«ç»ò¼g³£¿ù°Ú¡I
  1.     Range("U2") = "=D2>datevalue(" & D & ")"""
½Æ»s¥N½X
¶]VBAªº®É­Ô´N¿ù¤F¡K¡K·w°Ú¡I
ªì¾ÇVBA¥E¨ìtwbts

TOP

¦^´_ 3# play9091


        Range("U2") = "=D2>datevalue(" & D & ")"
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh


Range("U2") = "=D2>datevalue(" & D & ")"
¡õ
=D2>datevalue(2012/3/14)

¦ý¬O¤½¦¡­n¨D¦¨¤U­±³o­Ó¼Ë¤l
=B2>DATEVALUE("2012/3/14")

¤]´N¬O¤Ö¤F¡u"¡v³o­Ó²Å¸¹¡K¡K¥[¤£¶i¥h¡K¡K«ùÄò¹Á¸Õ¤¤¡I
ªì¾ÇVBA¥E¨ìtwbts

TOP

¦^´_ 5# play9091


    ¬Ý§Aµ{¦¡½Xªº¼gªk~
    D=Date-7   'À³¸Ó¬O¥Î¨t²Î¤é´Á´î7¤Ñ,¦A§Q¥ÎDªº¤é´Á¦bPÄæ¦ì¼g¤J¨ç¼Æ=D2-D
   ­Y±z­nªº¸ò§Ú²z¸Ñªº¬O¤@¼Ëªº¸Ü~
   ¤U­±ªº¤è¦¡´N¥i¥H¸Ñ¨M§Aªº°ÝÃD
   ¦ý»á¬°©_©Ç~ ¨Ï¥Îvba­nªº¦h¼Æ¬O±N¨ç¼Æ¹BºâÂন­È±a¤J~ ´î¤Ö­pºâ~
   §AÁÙ­n±N¨ç¼Æ¼g¥X¨Ó~ ¦A¥h°õ¦æ«áÄò°Ê§@~ ·Pı¦³ÂI~...²æXXXX.....
  1. Sub Week_KPI()

  2. A = Range("A65536").End(xlUp).Row
  3. D = Date - 7
  4. For I = 2 To A
  5.     Range("P" & I).Formula = "=B" & I & ">" & "Date(" & Year(D) & "," & Month(D) & "," & Day(D) & ")"
  6. Next
  7.     Range("A1:N65536").AdvancedFilter Action:=xlFilterInPlace, _
  8.         CriteriaRange:=Range("P1:Q2"), Unique:=False
  9. End Sub
½Æ»s¥N½X
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 5# play9091


        Range("U2") = "=D2>datevalue(""" & d & """)"
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 6# hugh0620

  ¥ý¶iÀ³¸Ó¬O¨S¦³¬Ý²M·¡§Ú¹ï¶·¨Dªº´y­z¡A¤S©ÎµÛ¬O§Ú´y­zªº¤£°÷²M·¡¡K¡K

§Ú·Q­n§â¸ê®Æ¤¤¤C¤Ñ«eªº¸ê®Æ¤£¯Ç¤J¦Ò¶q¡K¡K©Ò¥H¶·­n¨º¤@¬q¤½¦¡°µ¬°§P§O¡C

ÁÙ¬O»¡¥ý¶i¦³¤°»ò¤ñ¸û¦nªº¤èªk¥i¥H¤¶²Ð¤@¤U¡K¡K¤]Åý§Ú¥i¥H¦h¦h¾Ç²ß¡I
ªì¾ÇVBA¥E¨ìtwbts

TOP

¦^´_ 8# play9091

¶i¶¥¿z¿ï¥i¨Ï¥Î¤½¦¡§@¬°·Ç«h¨S¿ù
¦ý§AÀÉ®×»P§Aªºµ{¦¡½X±Ô­z¦³ÂI¥X¤J
À³¸Ó¦bP2¼g¤J¤½¦¡¤~¹ï
  1.     D = Date - 7
  2.     Range("P2") = "=B2>DATEVALUE(""" & D & """)"
  3.     Range("A1:N65536").AdvancedFilter Action:=xlFilterInPlace, _
  4.         CriteriaRange:=Range("P1:Q2"), Unique:=False
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 8# play9091

  1. Sub Week_KPI()
  2.     Range("P2") = ">" & Date - 7
  3.     Range("A1:N65536").AdvancedFilter Action:=xlFilterInPlace, _
  4.         CriteriaRange:=Range("P1:Q2"), Unique:=False
  5. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : §Ú­Ì³Ì¤jªº¼Ä¤H¤£¬O§O¤H¡D¥i¯à¬O¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD