Board logo

¼ÐÃD: ´Æ¤âªºexcel¹Bºâ°ÝÃD¡A¦p¦ó§ïµ½?? [¥´¦L¥»­¶]

§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-26 14:15     ¼ÐÃD: ´Æ¤âªºexcel¹Bºâ°ÝÃD¡A¦p¦ó§ïµ½??

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2016-1-26 14:18 ½s¿è

[attach]23180[/attach]
[attach]23181[/attach]
ªþÀɬO¤@­Ó¤p§Ì¥­±`¥Î¦b¬ö¿ýªºexcel¥Ø«e¦³¨Ç´Æ¤âªº¹Bºâ°ÝÃDÁٳ·Ъ©¤W¤j¤jÀ°§Ú¤@¤U

¦p¹Ï©Ò¥Ü¡A¥ªÃä¬O§Ú¥­®É¦b¬ö¿ýªºÀx¦s®æ¡A¥kÃä¬O­pºâ¥ÎªºÀx¦s®æ¡A¦ý¬O¦]¬°¥kÃä­pºâªºÀx¦s®æ¸Ì­±§Ú¦³¼g¤@¨Ç¨ç¼Æ¡A³y¦¨¾ã­Óexcel¦b¶]ªº®É­Ô¥ªÃäµLªk¬ö¿ý©Î¬O¾ã­Ó·í±¼(¦]¬°©Ò¼g¨ç¼Æ¤Ó¦YCPU©M°O¾ÐÅé)¡A½Ð°Ý¤@¤Uª©¤W¤j¤j¤pªº³o­Ó°ÝÃDÀ³¸Ó«ç»ò¸Ñ¨M¤~¦n??

§Ú¦³·Q¥X¤@¨Ç¸Ñ¨M¤è¦¡¡AµL©`¹ïVBA¤£¬O¤Ó¼ô¡A¦b·Ð½Ðª©¤W°ª¤âÀ°À°¦£

¸Ñ¨M¤è¦¡
1.Åý¥ªÃäA-F¦C§Y®É¹Bºâ(A2-F2¬ODDE©Ò¥H»Ý­nÀH®É§ó·s¤~¯à±µ¦¬¸ê®Æ)¡AR-T¦C¨C¤ÀÄÁ¹Bºâ¤@¦¸¡A§ó·s§¹«á¼g¦¨­È¦Ó¤£¬O¤½¦¡¡A³o¼Ëªº¤è¦¡¥i¥H¶Ü??(¤£ª¾¹D¦P¤@­Ósheet¥i¤£¥i¥H¤£¦PÀW²v§Y®É¹Bºâ)

2.ÅܧóR-T¦Cªº¨ç¼Æ¼gªk¡AÅý¾ã­Óµ{¦¡¶]°_¨Ó¤£­n¨º»ò¦Y¸ê·½

3.±NS-T¦Cªº¨ç¼Æ¼g¦bVBA¸Ì­±¡A¨C¤ÀÄÁ°õ¦æ¤@¦¸°õ¦æ§¹«á±N¤½¦¡¼g¦¨­È

·Ð½Ðª©¤Wªº°ª¤â¤j¤jÀ°À°¤p§Ì
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-26 19:45

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-1-26 20:00 ½s¿è

¦^´_ 1# ÂŤÑÄR¦À
¦b shtRTD (RTD) ªí³æ¤º RecordPrice()
¥[¤J STSumifs WR, WR¡A ¦p¤U¡G
  1. Option Explicit

  2. Sub RecordPrice()
  3.     Dim WR As Long
  4.     Dim I As Byte

  5.     If Range("P2") < 1 Then Exit Sub

  6.     WR = Range("A1").End(xlDown).Row + 1
  7.     '  ActiveWindow.ScrollRow = WR - 5     '  ¥uÅã¥Ü³Ì·s´Xµ§¸ê®Æ
  8.     If (WR = 3) Or _
  9.             (Range("F" & WR - 1) <> Range("F2")) Then   '  Á`¶q¦³²§°Ê®É¤~°O¿ý
  10.         For I = 1 To 6
  11.             Cells(WR, I) = Cells(2, I)
  12.         Next 'I
  13.         
  14.         STSumifs WR, WR                         '  ¸ê®Æ¦P¨B±N¼Æ­È¼g¤J¨ì R¡AS¡AT ¤TÄ椺
  15.     End If
  16.     '  With ActiveWindow
  17.         '  If Intersect(Cells(WR, "B"), .VisibleRange) Is Nothing Then .SmallScroll 5
  18.     '  End With
  19. End Sub

  20. Private Function STSumifs(ByVal endST As Long, Optional startST As Long = 3)
  21.     Dim cts As Long
  22.     Dim btm As Long
  23.    
  24.     btm = Range("A1").End(xlDown).Row
  25.    
  26.     For cts = startST To endST
  27.         Cells(cts, "R") = IIf(cts = 2, "", IIf(cts = 3, "=MAX(B3:B" & btm & ")", "=R" & (cts - 1) & "-1"))
  28.         Cells(cts, "R") = Cells(cts, "R").Value
  29.         Cells(cts, "S") = "=IF(SUMIFS($E3:$E" & btm & ",$D3:$D" & btm & ",S$1,$B3:$B" & btm & ",$R" & (cts - 1) & ")=0," & Chr(34) & Chr(34) & ",SUMIFS($E3:$E" & btm & ",$D3:$D" & btm & ",S$1,$B3:$B" & btm & ",$R" & (cts - 1) & "))"
  30.         Cells(cts, "S") = Cells(cts, "S").Value
  31.         Cells(cts, "T") = "=IF(SUMIFS($E3:$E" & btm & ",$D3:$D" & btm & ",T$1,$B3:$B" & btm & ",$R" & (cts - 1) & ")=0," & Chr(34) & Chr(34) & ",SUMIFS($E3:$E" & btm & ",$D3:$D" & btm & ",T$1,$B3:$B" & btm & ",$R" & (cts - 1) & "))"
  32.         Cells(cts, "T") = Cells(cts, "T").Value
  33.     Next cts
  34. End Function

  35. Sub Test()
  36.     Dim WR As Long
  37.    
  38.     WR = Range("A1").End(xlDown).Row
  39.     STSumifs WR
  40. End Sub
½Æ»s¥N½X
³Ì«á­±¤§ Test() ¬O¥iÅý§A¤@¦¸¦Û°Ê°õ¦æ§ó´« ²Ä 3 ¦æ ~ ²Ä 4903 ¦æ
R¡AS¡AT ¤TÄ檺¸ê®Æ­È¡C¦pªG¤£²§°Êªº¸Ü¡A´N¤£»Ý°õ¦æ¥¦¡C
¨ä¥¦µ{¦¡³¡¤À§¡«O¯d­ì»ª¡C¦]§ÚµL¨é°Ó³s½uµLªk´úª¾ª¬ªp¡C
§@ªÌ: jackyq    ®É¶¡: 2016-1-26 19:51

¥»©«³Ì«á¥Ñ jackyq ©ó 2016-1-26 19:55 ½s¿è

1, 3 ¤èªk¥i¦æ
R-T¦Cªº»Ý¨D¨C¤ÀÄÁ¤~¹Bºâ¤@¦¸
«oÅܦ¨³vµ§¹Bºâ
¬Æ¦ÜÁÙ³v¾ú¥v
¤£ºC³£Ãø
§@ªÌ: ­ã´£³¡ªL    ®É¶¡: 2016-1-26 21:29

SUMIFS , ºâ¨Ó´NºC, ¦óªp¥þÄæ¤Þ¥Î¡I¡I¡I

¥[¨â­Ó»²§UÄ椽¦¡¡G
¢Õ¢±¡G=IF($D2=S$1,$E2,"-")¡@¥k©Ô¢Ö¢±¡A¤U©Ô¨ì©³
¢á¢²¡G=SUMIF($B:$B,$R2,G:G)¡@¥k©Ô¢â¢²¡A¤U©Ô¨ì©³¡AÀx¦s®æ®æ¦¡¦Û­q¬°¡G#¡@¡]¢¯­È¤£Åã¥Ü¡^

¥t¥~¡A®É¶¡¤½¦¡§ï¦p¤U¡G
¢Ò¢±¡G=--TEXT(A2,"hhmm")
¢á¢°¡G=--TEXT(S2,"hhmm")
¢â¢°¡G=--TEXT(T2,"hhmm")
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-27 09:29

¦^´_ 1# ÂŤÑÄR¦À
½Ð°Ñ¦Ò¡G
¦p¦ó§â­ÓªÑ¨C 5 ¤ÀÄÁªº¦¨¥æ»ù®æ°O¿ý¤U¨Ó¡H
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-27 09:38

¦^´_ 2# c_c_lai
°õ¦æ«á¦³´X­Ó°ÝÃD¸òC¤j»¡¤@¤U
1.R¦C¦]¬°·|¸òµÛ«ü¼Æ³Ð·s°ª¦Ó§ïÅÜ©Ò¥H¤£¯à¬O¼g¦ºªº

2.R¦C¥u»Ý­n§ì³Ì°ª¨ì³Ì§C°Ï¶¡200­Ó¥ª¥k¡A¤£»Ý­n¤@ª½¦V¤U¼W¥[

3.°õ¦æ«áS¸òT¦C¨S¦³¥ô¦ó°Ê§@

¥t¥~¡A¦pªG§Ú·Q¦bS¦C¤§«á§e²{8:45-13:45¤§¶¡ªº©Ò¦³µ²ªG³o¼Ëªº¸Ü¤½¦¡­n«ç»ò§ï(·N«ä´N¬OS¼g¤J8:45¡BT¼g¤J8:46....¤@ª½¼g¨ì13:45)
PS.§Ú¬Ý¤F¤@¤U¥ÎR1C1ªº¤è¦¡¼g¤½¦¡¦n¹³´N¤£¥ÎÅܧó
=IF(SUMIFS(C5,C4,R1C,C2,R[-1]C18)=0,"",SUMIFS(C5,C4,R1C,C2,R[-1]C18))---¨C¤@¦æ³£³o¼Ë¡A³o¼Ë¦pªG­n¼g¨ì13:45¤À´NÀ³¸Ó¤£¥Î¿é¤J¤Ó¦h¤½¦¡¤F

C¤j§Úªº·Qªk¬O³o¼Ë§A¬Ý¬Ý¥i¤£¥i¦æ
R¦C¤£°Ê¡AS¦C¦b8:46:01-8:46:05¤§¤º¼g¤J¤½¦¡¡A5¬í¤º¬Æ¦Ü§óµu®É¶¡§¹¦¨­pºâ¡A¤§«á±N¤½¦¡¼g¦¨­È¡AT¡BU¡BV¦C¨Ì¦¹Ãþ±À(´N¬OÅý°õ¦æ®É¶¡¤£­n¤Ó¤[¡A°õ¦æ§¹¥ß¨è±N¤½¦¡¼g¦¨­È)
³o¥u¬O¤p§Ìªº¤@­Ó·Qªk¡AÁÙ½ÐC¤j¬Ý¬Ý¥i¤£¥i¦æ
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-27 11:51

¦^´_ 6# ÂŤÑÄR¦À
»¡¯uªº¡A§Ú¤£¤ÓÀ´ SUMIFS ªº¥Î·N¡A¥u¬O¨Ì¼Ëµe¸¬¡C
¦p§A¦³®É¶¡ªº¸Ü¡Aµyµy»¡©ú¤@¤U¥¦ªº¨Ï¥Î¤è¦¡»P§Aªº·Qªk¡A
¦p¦¹·|§ó©úÁA¨ä§@¥Î¡AÁÂÁ¡C
§@ªÌ: ­ã´£³¡ªL    ®É¶¡: 2016-1-27 12:43

¦^´_ 6# ÂŤÑÄR¦À


8:45-13:45 = ¢²¢¯¢¯¤ÀÄÁ¡@
R¦C¥u»Ý­n§ì³Ì°ª¨ì³Ì§C°Ï¶¡200­Ó¥ª¥k
¡@

300*200 ­ÓSUMIFS¡A¶]±o°Ê¶Ü¡H¡H¡H
§@ªÌ: ­ã´£³¡ªL    ®É¶¡: 2016-1-27 13:49

°µ­Ó°Æµ{¦¡¡A©T©w®É¶¡¥h CALL §Y¥i¡A
Äæ¦ì¤£°÷¡A¥u°µ¨ì 08:45 ~ 12:00 ¦@ 196 Äæ¡A¦Û¦æ¥h½Õ¾ã¡G
¡@
Sub ²Î­p()
Dim R&, C&, Arr, Brr(1 To 200, 1 To 196), uMax, i&
R = Cells(Rows.Count, 1).End(xlUp).Row
If R < 2 Then Exit Sub
Arr = Range("A2:E" & R).Value
uMax = [R3] '³Ì¤j¦¨¥æ¼Æ
For i = 1 To UBound(Arr)
¡@¡@R = uMax - Arr(i, 2) + 1  '³Ì¤j¦¨¥æ¼Æ - ¢ÐÄ榨¥æ¼Æ + 1 = ¦C¦ì
¡@¡@If R < 1 Or R > 200 Then GoTo 101
    ¡@
¡@¡@C = Int(Arr(i, 1) * 1440) - 524 '¢ÏÄæ®É¶¡¤ÀÄÁ¼Æ - 8:44¤ÀÄÁ¼Æ = Äæ¦ì
¡@¡@If C < 1 Or C > 196 Then GoTo 101
    ¡@
¡@¡@Brr(R, C) = Brr(R, C) + Arr(i, 5)
101: Next
[S3].Resize(200, 196) = Brr
Beep
End Sub

°Ñ¦ÒÀÉ¡G
[attach]23188[/attach]
¡@
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-27 13:55

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2016-1-27 14:01 ½s¿è

¦^´_ 7# c_c_lai

C¤j§Ú»¡©ú¤@¤U¡A§Úªº¥D­n¥Î·N¬O¥ªÃä¬ö¿ý¶q¡A¥kÃä§Ú®Ú¾Ú®É¶¡©M¤£¦Pªº¦¨¥æÂI¦ì¨Ó¥[Á`
¨Ò¦p¡G
12:58:55        7775        1        1258        -1                                             
12:58:56        7776        1        1258        -1
12:58:56        7776        1        1258        -1
12:58:58        7775        25        1258        1
12:58:58        7775        1        1258        -1
12:58:58        7775        1        1259        -1
12:59:00        7774        4        1259        -1
12:59:00        7774        1        1259        -1
12:59:00        7774        1        1259        -1
12:59:01        7775        1        1259        -1
12:59:01        7774        1        1259        -1
12:59:02        7774        1        1259        -1
12:59:02        7774        5        1259        -1
12:59:03        7774        12        1259        1

¥kÃä¬O±N12:58¸Ì­±ªº©Ò¦³7775¡B7776¡B7774ªº¶q¥[Á`¡A¦ý¤£¥[Á`12:58¤À¥H¥~ªº¶q¡A³o´N¬O§Ú¬°¤°»ò¥ÎSUMIFSªº­ì¦]¡A¦pªG¥ÎSUMIF«h·|±N·í¤Ñ©Ò¦³¦P»ù¦ì©Î¦P®É¶¡ªº¼Æ¦r³£¥[Á`¡A¦Ó§Ú­nªº¥u¬O¬Y­Ó®É¶¡¬q¸Ì­±¦³¥X²{ªº»ù¦ìªº¥[Á`
¦p¤W©Ò¥Ü
7776  -2        12:58¤À¸Ì­±7776¥X²{2¦¸¡A³Ì«á­±ªº¼Æ¦r¥[Á`¬O-2
7775  -3        12:58¤À¸Ì­±7775¥X²{3¦¸¡A³Ì«á­±ªº¼Æ¦r¥[Á`¬O-3
7774   0         12:58¤À¸Ì­±7774¥X²{0¦¸¡A³Ì«á­±ªº¼Æ¦r¥[Á`¬O0
¤j·§´N¬O³o¼Ë¡AC¤j¯à²z¸Ñ¶Ü??
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-27 13:58

¦^´_ 8# ­ã´£³¡ªL
©Ò¥H¨ç¼Æ¤£¯àª½±µ¥´¦bÀx¦s®æ¤W­±¡A­n¥ÎVBA¥B°õ¦æ§¹­n°¨¤W±N¤½¦¡Âন­È¡A­n¤£µM¤@¼Ë·|©ìºC³t«×
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-27 13:59

¦^´_ 9# ­ã´£³¡ªL

¤j¤j¥i¥H»¡©ú¤@¤U¥Îªk©M­ì²z¶Ü??§Ú¬Ý¤£¤ÓÀ´¡A©êºp
ÁÂÁ§AªºÀ°¦£
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-27 14:10

¦^´_ 9# ­ã´£³¡ªL

¤j¤j¦n¼F®`¡A¦ý½Ð±Ð¤@¤U
1.¬O¨C¤ÀÄÁ³£­n¦Û¤v«ö²Î­p¶Ü??
2.«ö²Î­pªº¹Lµ{¤¤·|³y¦¨EXCELÅܺC¶Ü??
3.¦pªG§â¥¦§ï¦¨¦Û°Ê¨C¤ÀÄÁ²Î­p¤@¦¸¥i¥H¶Ü??
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-27 14:14

¦^´_ 7# c_c_lai


    C¤j§Ú­nªº®ÄªG¤j·§¸ò7¼Ó¤j¤jªºªþ¥ó¤@¼Ë§A¬Ý¤@¤U
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-27 15:30

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-1-27 15:31 ½s¿è

¦^´_ 12# ÂŤÑÄR¦À
³o¬O§A­ì¥»ªº©w¸q¡G
  1. S3
  2. =IF(SUMIFS($E:$E,$D:$D,S$1,$B:$B,$R2)=0,"",SUMIFS($E:$E,$D:$D,S$1,$B:$B,$R2))
  3. T3
  4. =IF(SUMIFS($E:$E,$D:$D,T$1,$B:$B,$R2)=0,"",SUMIFS($E:$E,$D:$D,T$1,$B:$B,$R2))
½Æ»s¥N½X
³o¬Oµ{¦¡½X¸ÑªRªºµ²ªG¡G
  1. S3
  2. =IF(SUMIFS($E3:$E4903,$D3:$D4903,S$1,$B3:$B4903,$R2)=0,"",SUMIFS($E3:$E4903,$D3:$4903,S$1,$B3:$B4903,$R2))
  3. T3
  4. =IF(SUMIFS($E3:$E4903,$D3:$D4903,T$1,$B3:$B4903,$R2)=0,"",SUMIFS($E3:$E4903,$D3:$D4903,T$1,$B3:$B4903,$R2))
½Æ»s¥N½X
µM«á¦AÂର¼Æ­Èªí¥Ü¡C
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-27 16:06

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-1-27 16:15 ½s¿è

¦^´_ 14# ÂŤÑÄR¦À
Function STSumifs(ByVal endST As Long, Optional startST As Long = 3)
1.  Optional startST As Long = 3 ªº¥Î·N¡A¨Æ¥ý½á¤©¹w³]­È¡F
    ¨Ò¦p:
    Sub Test()
        Dim WR As Long
   
        WR = Range("A1").End(xlDown).Row   '  ³Ì«á¤@µ§¸ê®Æ¦C
        STSumifs WR
    End Sub
    ¦b STSumifs ªº¨ç¦¡¤¤¡G
        For cts = startST To endST
    startST µ¥©ó 3¡A endST  µ¥©ó WR (4903)
    ¦¹®É STSumifs WR = STSumifs WR, 3 ¤§·N¡A
    Optional  ªºÅܼƫŧi¡A¦p¥¼±a¤J­È¡A«h¥H¨ä
   ³]©wªº¹w³]­È (3) ¬°°Ñ¼Æ­È¡C
    ***  ³o¬O¤@¦¸´N³B²z 3 ~ 4903 §¹²¦¡C
     
2.  °²³]±a¤J­È¬°¡G
    WR = Range("A1").End(xlDown).Row + 1 '  ³Ì«á¤@µ§¸ê®Æ¦C + 1
    STSumifs WR, WR
    startST µ¥©ó WR¡A endST  µ¥©ó WR (4094)
    ***  ³o¬O±N¸ê®Æ¼g¤J¨ì¸ê®Æ¿ýªº³Ì«á¦C¡C
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-27 17:04

¦^´_ 16# c_c_lai

«¢«¢¡A¦³ÂI½ÆÂø¡A¬Ý¤£¤ÓÀ´¡A¤£¹LÁÙ¬OÁÂÁÂC¤j¡A§Ú©ú¤Ñ¥ý¨Ó´ú¸Õ´£¤jªº¬Ý¬Ý
§@ªÌ: ­ã´£³¡ªL    ®É¶¡: 2016-1-27 21:17

¤j·§°µ­Ó¨C¤ÀÄÁ¡e¦Û°Ê²Î­p¡f¡A¤£¨¬¤§³B¦Û¦æ½Õ¾ã¡A
­Y»P¦Û°Ê°O¿ý¢Ò¢Ò¢Ó¦³½Ä¬ð®É¡A¤]½Ð¦Û¦æ¥h±Æ°£¡I¡I
¡@
[attach]23189[/attach]
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 08:50

¦^´_ 18# ­ã´£³¡ªL
·Ç¤j¡A§Ú´ú¸Õ¤F¤@¤U¬Q¤Ñ¨º­Ó¤â°Êªºª©¥»¡Aµo²{»ù®æµLªk¦Û°Ê°O¿ý¤F¡A¥i¥H½Ð­ã¤jÀ°À°¦£¶Ü??
¤p§Ì²³æªº¥i¥H¡A¦ý¬O³o¹ï¤p§Ì¨Ó»¡¤w¸g¶W¥X¯à¤O½d³ò¤F¡A·PÁÂ
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 08:51

¦^´_ 16# c_c_lai

C¤j¡A¬Q¤Ñ7¼Óªºªþ¥ó¸g´ú¸Õ«áµLªk°O¿ý»ù®æ¡A¥i¥H½ÐC¤jÀ°§Ú¬Ý¬Ý¶Ü??
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-28 10:41

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-1-28 10:48 ½s¿è

¦^´_ 20# ÂŤÑÄR¦À
§A»¡ªº "¬Q¤Ñ7¼Óªºªþ¥ó¸g´ú¸Õ«áµLªk°O¿ý»ù®æ"¡A
7¼Ó ¨º¨Óªºªþ¥ó¡H
§A«üªº¬O¡H
  1. Sub RecordPrice()
  2.     Dim WR As Long
  3.    Dim I As Byte

  4.    If Range("P2") < 1 Then Exit Sub
  5.     WR = Range("A1").End(xlDown).Row + 1
  6.    '  ActiveWindow.ScrollRow = WR - 5     '  ¥uÅã¥Ü³Ì·s´Xµ§¸ê®Æ
  7.     If (WR = 3) Or _
  8.            (Range("F" & WR - 1) <> Range("F2")) Then   '  Á`¶q¦³²§°Ê®É¤~°O¿ý

  9. .        For I = 1 To 6
  10.             Cells(WR, I) = Cells(2, I)
  11.        Next 'I
  12.         STSumifs WR, WR                         '  ¸ê®Æ¦P¨B±N¼Æ­È¼g¤J¨ì R¡AS¡AT ¤TÄ椺
  13.   End If
  14.    '  With ActiveWindow
  15.         '  If Intersect(Cells(WR, "B"), .VisibleRange) Is Nothing Then .SmallScroll 5
  16.     '  End With
  17. End Sub
½Æ»s¥N½X
§Aªºµ{¦¡½X¤¤¦³¥[¤J³o¤@¦æ¶Ü¡H
  1. STSumifs WR, WR                         '  ¸ê®Æ¦P¨B±N¼Æ­È¼g¤J¨ì R¡AS¡AT ¤TÄ椺
½Æ»s¥N½X
§Aªº­ì©l½X¬O¦b Workbook_Calculate() ¸Ì°õ¦æªº¡A
½ÐÀˬd¤@¤U¡C
­ã´£³¡ªLª©¤jªº¤À¨É¥ç­È±o§A¬ã¨s°Ñ¦Ò¡A§A·Q­nªºµª®×
¬O¤£¬O¨º¼Ë¡H
§Úªºµ{¦¡½X STSumifs() ¥u¬O±N§A¥»¨Ó¤§¤½¦¡ (Formula) ¥Hµ{¦¡¼Ò¦¡»P¸ê®Æ¦P¨B¼g¤J
¦Ó¤w¡A¨S°µ¥ô¦ó¤§©µ¦ù³Ð·N¡C¦]¬°§Ú¤£À´§A¤½¦¡ªº§@¥Î¡C¬Ý¤F­ã´£³¡ªLª©¤jªº¤À¨É
¤~µyµy©úÁA§A­nªºµ²ªG¥i¯à·|¬O¦p¦¹¡AÁÙ¬O¥t¦³·Qªk¡H
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 12:16

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2016-1-28 12:23 ½s¿è

¦^´_ 21# c_c_lai

¥´¿ù¡AÀ³¸Ó¬O9¼Ó¤~¹ï
C¤j»¡¥[¨º­Ó¬O«ü§Aªºµ{¦¡§a¡A§Ú­±«e¥Î9¼Óªºªþ¥ó¦A¶]¨S¥[¡A´N¬O»ù®æµLªk¬ö¿ý
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-28 12:57

¦^´_ 22# ÂŤÑÄR¦À
[attach]23193[/attach]
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 13:24

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2016-1-28 13:31 ½s¿è

¦^´_ 23# c_c_lai

C¤j§Ú§â¥¦¥þ³¡§Ë¦^¥h«á¡A¥i¥H°O¿ý¡A¦ý«o¤£¬O§Ú­ì¥»³]©wªºÅܰʤ~¬ö¿ý¡A¬°¤°»ò·|³o¼Ë??
[attach]23194[/attach]
²{¦b¨SÅܰʤ]°O¿ý¡A¬O­þÃä¥X¿ù¤F¶Ü??
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-28 13:35

¦^´_ 24# ÂŤÑÄR¦À
§A§â§A¥Ø«eªºExcelÀÉ®×À£ÁY¤W¶Ç¡A
²´¨£¬°¾Ì¡I
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 13:44

¦^´_ 25# c_c_lai
[attach]23195[/attach]
¨â­ÓÀɮסA³£¬O­ã¤jªº¤@­Ó¤â°Ê¡A¤@­Ó¦Û°Ê¡A©êºpÀ³¸Ó¦­ÂI¤W¶Çªº
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-28 14:06

¦^´_ 26# ÂŤÑÄR¦À
§A»¡ "¥i¥H°O¿ý¡A¦ý«o¤£¬O§Ú­ì¥»³]©wªºÅܰʤ~¬ö¿ý"
¦¹¸Ü«ç»¡¡H
§A¶}±ÒÀɮ׫á¡A¥¦·|±q DDE ¶×¤J§Y®É¼Æ¾Ú¡A±µµÛ¥¦«K¦Û°Ê§PÂ_
Á`¶q¦³²§°Ê®É¤~°O¿ý¡A³o­Ó¹Lµ{¤£¹ï¶Ü¡H"¤£¬O§A­ì¥»³]©wªºÅܰʤ~¬ö¿ý"
¬O¬Æ»ò±¡§Î¡A¦]§Ú¨S¨é°Óªº³nÅé©Ò¥HµL±q±oª¾®t²§¦b¨ºùØ¡C
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 14:10

¥»©«³Ì«á¥Ñ ÂŤÑÄR¦À ©ó 2016-1-28 14:12 ½s¿è

¦^´_ 27# c_c_lai


    ¬Ý24¼ÓºI¹Ï¡AF¦C¦b¬ö¿ý®É¬Û¦P¤]°O¿ý¤F¦Ó¥B³£¬O¦P¼Ë¸ê®Æ¡AF42-F52³£¬O¬Û¦Pªº¡A¦ý¬O¥L¤]°O¿ý¤F¡A¥¿±`¤£À³¸Ó¬O³o¼Ë
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-28 14:43

¦^´_ 28# ÂŤÑÄR¦À
¨º§A¦AÆ[¹î¤@¤U F2 Ä檺¼Æ¾Ú¦³¨S¦³¤@ª½¦bÅÜ°Ê¡H
¦p¨S¡A«h§A¥²¶·­«·s¦A¦¸±Ò°Ê¨é°Óªº³nÅé¡C
§@ªÌ: ­ã´£³¡ªL    ®É¶¡: 2016-1-28 16:56

¦^´_ 28# ÂŤÑÄR¦À


Private Sub Workbook_Open()
Call ²Î­p_±Ò°Ê
Application.RTD.ThrottleInterval = 0
Application.Calculation = xlCalculationManual   '¶}±ÒÀÉ®×´N±N¡e¦Û°Ê­«ºâ¡fÃö³¬¡A«ç¥i¯àIJ°Ê¡eCalculate¡f¡@
End Sub
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 17:14

¦^´_ 29# c_c_lai

¦³¡A¤@ª½¦³ÅÜ°Ê
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 17:15

¦^´_ 30# ­ã´£³¡ªL


    ·Ç¤j¡A§Ú¤£¤ÓÀ´§Aªº·N«ä
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-28 18:24

¦^´_ 31# ÂŤÑÄR¦À
§A§â ThisWorkbook ¸Ìªº¨ç¼Æ¤º®eµy¥[²§°Ê
µM«á¤©¥HÀx¦s«á¡AÃö³¬­«¶} Excel¡G
  1. Option Explicit

  2. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  3.     Application.RTD.ThrottleInterval = 2000
  4.     Application.Calculation = xlCalculationAutomatic
  5. End Sub

  6. Private Sub Workbook_Open()
  7.     Application.RTD.ThrottleInterval = 0
  8.     Application.Calculation = xlCalculationManual
  9. End Sub
½Æ»s¥N½X
­×§ï¦¨¡G
  1. Option Explicit

  2. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  3.     Application.RTD.ThrottleInterval = 0
  4.     Application.Calculation = xlCalculationManual
  5. End Sub

  6. Private Sub Workbook_Open()
  7.     Application.RTD.ThrottleInterval = 2000
  8.     Application.Calculation = xlCalculationAutomatic
  9. End Sub
½Æ»s¥N½X
¦A­«·s¸Õ¸Õ¬Ý¡C
³o«K¬O­ã´£³¡ªLª©¤j°Ý§Aªº°ÝÃD¡C
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-28 21:46

¦^´_ 33# c_c_lai


    ¥i¬O¤§«e³o¼Ë³]©w¯à¶]¡A¬°¤°»ò¥[¤F­ã¤jªºµ{¦¡¤§«á´N¤£¯à¶]©O??
§@ªÌ: c_c_lai    ®É¶¡: 2016-1-29 07:34

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-1-29 07:38 ½s¿è

¦^´_ 34# ÂŤÑÄR¦À
§Ú«e«e«á«á¬d¬Ý¤F§A»P­ã´£³¡ªLª©¤j¤W¶Ç¤À¨ÉªºÀɮסA
µo²{°ÝÃD¤´µM¥X¦Û©ó§Aªº¦Û¦æ¦A¾ã¦X¡A­ã´£³¡ªLª©¤j
¤W¶Çªº¤º®e³£¨S¥[¤J Workbook_Open() ªº°õ¦æ¤º®e¡A
¬Æ¦Ü¦b²Ä¤@¦¸µ¹ªº Xl0000328.rar ¤]¥ç±N¥¦ Marked ±¼¡A
§A¥u±N¥¦¤À¨É¼Ò²Õ¤ºªº Sub ²Î­p() ª½±µ¶K¤J¨ì§A­ì¥»ªºÀɮפº
©Ò¥H¤~·|³y¦¨¥¼¯à¥¿±`°õ¦æªº­ì¦]¡C¬°À°§U§A§ó¯à©úÁAª©¤j
¼Ò²Õªº¹B§@¡A¯S¤©¦b¨ä¼Ò²Õ¤º¨C¤@´`Àô²Ó³¡¤ÀªR¸Ñ»¡¡A§Æ±æ§A
¯à¶i¤@¨B¾Ç²ß¨ì¦p¦ó¹B¥Î¡A¦P®É¯à¼W¶i§A¥»¨­ªº¦Û§ÚÆ[¹î¤O¡C
§Ú±N¤T¤èªºµ{¦¡¼Ò²Õ¤©¥H²Õ¦X¤W¶Ç¤W¨Ó¡A§A´ú¸Õ¬Ý¬Ýµ²ªG¦p¦ó¡C
¸ÑÀ£«á«Kª½±µ¥Î¥¦¨Ó°õ¦æ´ú¸Õ¡A¦p¦¹¤~±o¥HÆ[´ú¨ä´ú¸Õµ²½×¡C
[attach]23203[/attach]
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-1-29 08:48

¦^´_ 35# c_c_lai

C¤j©p¯u¬O¤Ó²Ó¤ß¤F¡A·PÁ§A¡A§Ú¥ý¬ã¨s¬Ý¬Ý¡AÁÂÁÂ
§@ªÌ: c_c_lai    ®É¶¡: 2016-2-1 08:30

¦^´_ 36# ÂŤÑÄR¦À
³Ìªñ¦³ÂI¨Æ¯ÔÀÁ¤F¡C
§A¦b #10 ¸Ìªº»¡©ú¡A­nªº¬O¡H
[attach]23219[/attach]
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-2-1 09:58

¦^´_ 37# c_c_lai


    ´ú¸ÕC¤jªºÀɮ׫á¡Aµo²{¥i¯à°õ¦æ¤Ó¦hªF¦è¡ADDE³£¤£¤Ó·|¸õ°Ê¤F¡A¤§«e1¬í¸õ7-8¦¸¡A²{¦b2-3¬í¸õ°Ê¤@¦¸
§@ªÌ: c_c_lai    ®É¶¡: 2016-2-1 11:17

¦^´_ 38# ÂŤÑÄR¦À
¨º§A¥Î§Ú¥Ø«e¤W¶ÇªºÀɮרӰµ´ú¸Õ¬Ý¬Ý¡C
´ú¸Õ§¹«á§i¶D§Ú¤@Ánµ²ªG¡C
§Ú¥ý§â­ã´£³¡ªLª©¤j¤À¨Éªº¥\¯à§ï¬° ²Î­pA()¡A
¥ý¤£¤©°õ¦æ¡A¦Ó¥h°õ¦æ§Ú¼W¥[¤§´ú¸Õ¼Ò²Õ
²Î­p() ->dicStatics §AÆ[¹î¬Ý¬Ý¶i¦æ¶¶ºZ§_¡H
[attach]23220[/attach]
§@ªÌ: c_c_lai    ®É¶¡: 2016-2-1 11:48

¦^´_ 38# ÂŤÑÄR¦À
  1. Sub ²Î­p()        '  L¡BM¡BN¡BO Äæ¦ì²Î­p
  2.     Dim DD As Date
  3.    
  4.     dicStatics
  5.     DD = Format(Now, "yyyy/mm/dd hh:mm")    '  DD = 2016/1/28 ¤W¤È 12:41:00 : Date
  6.     TimeTxt = DD + 1 / 1440                 '  TimeTxt = 2016/1/28 ¤W¤È 12:42:00 : Variant/Date
  7.     Application.OnTime TimeTxt, "²Î­p"      '  ¨C¤@¤ÀÄÁ¦Û°Ê¦A¦¸°õ¦æ¤@¦¸¡C
  8. End Sub

  9. Sub dicStatics()
  10.     Dim txt As String, dic As Object, dic2 As Object, A As Range, sp As Variant

  11.     ' txt = [B2] & Left(CStr(Format([A2], "HH:MM:SS")), 5)
  12.     ' txt = [B2] & Left(CStr([A2]), 5)
  13.     '  MsgBox txt

  14.     Set dic = CreateObject("Scripting.Dictionary")
  15.     Set dic2 = CreateObject("Scripting.Dictionary")

  16.     For Each A In Range([A3], [A3].End(xlDown))
  17.         txt = A.Offset(, 1) & "," & Left(Format(A, "HH:MM:SS"), 5)
  18.         '  dic(txt) = IIf(IsEmpty(dic(txt)), A.Offset(, 4).Value + 1, dic(txt)) + A.Offset(, 4).Value
  19.         '  ¦b IsEmpty(dic(txt)) §PÂ_®É¡A dic(txt) ·|¦Û°Ê¥ý½á¤©¤@¦¸¤§ A.Offset(, 4).Value ­È¡AµM«á¦A¦¸
  20.         '  Assign ¤@¦¸ªº A.Offset(, 4).Value ­È¡A ¦p A.Offset(, 4).Value = -1¡A«hµ²ªG·|Åܦ¨ -2¡C
  21.         '  ¬O¬G§ï¦¨¦p¤U¤è¦¡¡Aª½±µ½á¤©¤@¦¸¤§ A.Offset(, 4).Value ­È¡A«hµ²ªG«K·|Åܦ¨ -1 (ªì©l­È³]©w)¡C
  22.         dic(txt) = dic(txt) + A.Offset(, 4).Value       '  ¦¸
  23.         dic2(txt) = dic2(txt) + A.Offset(, 2).Value     '  ¶q
  24.     Next
  25.    
  26.     [M3].Resize(UBound(dic.Keys) + 1) = Application.Transpose(dic.Keys)                '  ¯Á¤Þ­È´N¬O Keys
  27.     [N3].Resize(UBound(dic.Keys) + 1) = Application.Transpose(dic.Items)               '  ¸ê®Æ¤º®e´N¬O Items
  28.     [O3].Resize(UBound(dic2.Keys) + 1) = Application.Transpose(dic2.Items)               '  ¸ê®Æ¤º®e´N¬O Items
  29.    
  30.     With [M3].Resize(UBound(dic.Keys) + 1, 3)        '  Range("M3:M" & [M3].End(xlDown).Row)
  31.         .Cells.Sort Key1:=.Cells(1), Order1:=xlDescending, Header:=xlNo    '  xlAscending
  32.     End With
  33.    
  34.     For Each A In Range([M3], [M3].End(xlDown))
  35.         sp = Split(A, ",")
  36.         A.Offset(, -1) = sp(0)
  37.         A = sp(1)
  38.     Next
  39. End Sub
½Æ»s¥N½X

§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-2-3 09:41

¦^´_ 40# c_c_lai


    ¥i¥H°O¿ý¡A¦ý¤£¥i²Î­p¡AC¤jÁÂÁ¡A§Ú·Q§ÚÁÙ¬O§ï¥ÎAPI+EXCELªº¤è¦¡¶i¦æ¦n¤F¡A¤£¥Î¦A¶O¤ß¤F¡A¯uªº«D±`ªºÁÂÁ©p
§@ªÌ: GBKEE    ®É¶¡: 2016-2-3 09:49

¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-2-3 10:34 ½s¿è

¦^´_ 38# ÂŤÑÄR¦À

ªþÀɸոլݬݥt¤@§@ªk

[attach]23240[/attach]
   

[attach]23238[/attach]

ThisWorkbook¼Ò²Õ
  1. Option Explicit
  2. Private Sub Workbook_BeforeClose(Cancel As Boolean) '
  3.     'ÀÉ®×Ãö³¬:Ãö³¬Àɮ׳sµ²
  4.     '**Àɮצb¶}±Ò®É,¤£±Ò°Ê¸ß°Ý§ó·s¸ê®Æªºµøµ¡
  5.    
  6.     ActiveWorkbook.UpdateLinks = xlUpdateLinksNever
  7.     'UpdateLinks ÄÝ©Ê ¶Ç¦^©Î³]©w XlUpdateLink ±`¼Æ¡A¦¹±`¼Æ¥i«ü¥X¬¡­¶Ã¯§ó·s¤º´O OLE ³s½uªº³]©w¡CŪ/¼g¡C
  8.    
  9.     'XlUpdateLinks ¥i¥H¬O³o¨Ç XlUpdateLinks ±`¼Æ¤§¤@¡C
  10.     'xlUpdateLinksAlways ¥Ã»·§ó·s«ü©w¬¡­¶Ã¯ªº¤º´O OLE ³s½u¡C
  11.     'xlUpdateLinksNever ¥Ã»·¤£§ó·s«ü©w¬¡­¶Ã¯ªº¤º´O OLE ³s½u¡C
  12.     'xlUpdateLinksUserSetting  ®Ú¾Ú¨Ï¥ÎªÌ¹ï«ü©w¬¡­¶Ã¯ªº³]©w¨Ó§ó·s¤º´Oªº OLE ³s½u¡C
  13. End Sub

  14. Private Sub Workbook_Open()
  15.     Application.Calculation = xlAutomatic  ' ¬¡­¶Ã¯³]¬°¦Û°Ê­«ºâ
  16.     'Àɮצb¶}±Ò®É:¦Û°Ê§ó·s³sµ²
  17.     With ActiveWorkbook
  18.         .UpdateRemoteReferences = True
  19.         .SaveLinkValues = True
  20.     End With
  21. End Sub
½Æ»s¥N½X
Sheet1(Sheets("RTD")) ¼Ò²Õªºµ{¦¡½X
  1. Option Explicit
  2. Dim D As Object, xTime As Date, Volume As Double
  3. Private Sub Worksheet_Calculate()
  4.     If IsError([E2]) Or Time < #8:45:00 AM# Then Application.StatusBar = "µ¥­Ô¶}½L¤¤": Exit Sub
  5.    
  6.     '[E2] = "--" ¶}½L«eªº²Å¸¹
  7.    If Volume <> [E2] And [E2] <> "--" And Time >= #8:45:00 AM# And Time < #1:46:00 PM# Then
  8.         If D Is Nothing Then
  9.             Application.OnTime #1:46:00 PM#, "SHEET1.¬ö¿ý"  '¦¬½L«á±j¨î¼g¥X³Ì«á¤@¤ÀÄÁªº¸ê®Æ
  10.             Application.StatusBar = False
  11.             Set D = CreateObject("scripting.dictionary")
  12.             Range("A" & Rows.Count).End(xlUp).CurrentRegion.Offset(1) = ""
  13.             Sheets("¬ö¿ý").UsedRange.Clear
  14.             xTime = TimeSerial(Hour(Time), Minute(Time), 0)
  15.         End If
  16.         If TimeSerial(Hour([B2]), Minute([B2]), 0) <> xTime And D.Count > 0 Then ¬ö¿ý '¤U¤@¤ÀÄÁ¶}©l®É,¬ö¿ý¤W¤@¤ÀÄÁªº¬ö¿ý
  17.         D([C2].Value) = D([C2].Value) + IIf([D2] <= 10, -1, 1)    '¦r¨åª«¥ó:¬ö¿ý¦¨¥æ³æ¶q¤½¦¡ªº­È
  18.         Volume = [E2]
  19.         xTime = TimeSerial(Hour([B2]), Minute([B2]), 0)
  20.         '**************** °O¿ý¨C¦¸¦¨¥æ¬ö¿ý***************
  21.          With Range("A" & Rows.Count).End(xlUp).Offset(1)
  22.             .Cells(1) = [B2]                        '®É¶¡
  23.             .Cells(1, 2) = [C2]                     '¦¨¥æ»ù
  24.             .Cells(1, 3) = [D2]                     '¦¨¥æ³æ¼Æ
  25.             .Cells(1, 4) = IIf([D2] <= 10, -1, 1)   '¦¨¥æ³æ¶q¤½¦¡ªº­È
  26.         End With
  27.         '************************************************
  28.     End If
  29. End Sub
  30. Private Sub ¬ö¿ý()
  31.     Dim R As Integer, C As Integer, X As Integer
  32.     Application.EnableEvents = False
  33.     With Sheets("¬ö¿ý")
  34.         If .[A1] = "" Then .[A1] = "®É¶¡"
  35.         With .Range("A" & .Rows.Count).End(xlUp).Offset(1)
  36.             R = .Row
  37.             .NumberFormat = "HH:MM"
  38.             .Value = xTime
  39.             .Resize(2).Merge
  40.         End With
  41.         C = 2
  42.         '°j°é:¦r¨åª«¥óªºKEY(ÃöÁä¦r) ³Ì¤j­È - ³Ì¤p­È.
  43.         For X = Application.Max(D.KEYS) To Application.Min(D.KEYS) Step -1
  44.             If D.EXISTS(X) Then   '¦r¨åª«¥ó¦³³o­ÓKEY(ÃöÁä¦r)
  45.                 If .Cells(1, C) = "" Then .Cells(1, C) = C - 1
  46.                 .Cells(R, C) = X
  47.                 .Cells(R, C).Interior.ColorIndex = 40
  48.             
  49.                 .Cells(R + 1, C) = D(X)
  50.                 C = C + 1
  51.             End If
  52.         Next
  53.     End With
  54.     D.RemoveAll   '­«³],¦r¨åª«¥ó(¬ö¿ý¦¨¥æ»ùªº¤½¦¡ªº­È)
  55.    
  56.    '³o¦æªºµ{¦¡½X¥i§R°£¤W¤@¤ÀÄÁªº¸ê®Æ,¥[³tµ{¦¡ªº¹B¦æ
  57.     Range("A" & Rows.Count).End(xlUp).CurrentRegion.Offset(1) = ""    '¦p­n«O¯d¥iµù¸Ñ±¼¤£¥²°õ¦æ
  58.     Application.EnableEvents = True
  59. End Sub
½Æ»s¥N½X

§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-2-3 16:24

¦^´_ 42# GBKEE


    G¤j¤µ¤Ñ¥xªÑ«ÊÃö¤F¡A­n¸Õ¤]­nµ¥¹L¦~«á¤F¡AÁÂÁ©p
§@ªÌ: jackyq    ®É¶¡: 2016-2-3 17:20

¦^´_ 43# ÂŤÑÄR¦À


    «ÊÃö¤@¼Ë¥i¸Õ
§@ªÌ: ÂŤÑÄR¦À    ®É¶¡: 2016-2-23 17:37

¦^´_ 40# c_c_lai

http://forum.twbts.com/viewthread.php?tid=16452&extra=
C¤j·s¦~§Ö¼Ö¡A¦³ªÅ¥i¥H³Â·ÐÀ°§Ú¬Ý¬Ý¶Ü??




Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)