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

¡y¤w¸Ñ¨M¡z°}¦C¤ñ¸û¡A§ä¥X®t²§ªºÀx¦s®æ

¡y¤w¸Ñ¨M¡z°}¦C¤ñ¸û¡A§ä¥X®t²§ªºÀx¦s®æ

¥»©«³Ì«á¥Ñ ko310kmo ©ó 2011-5-14 17:06 ½s¿è

test.rar (13.84 KB)
DDE¶Ç­Èªº¤è¦¡¥u¯àIJ°ÊCalculate¨Æ¥ó¡A¦ÓµLªkIJ°ÊChange¨Æ¥ó

sheet1ªº
BÄæ¬O¦U­Ó»ù¦ì
CÄæ¬O¦¨¥æ»ù
DÄæ¬O³æ¶q
C¡BDÄæ«ùÄò±µ¨üDDE¶Ç­È

¥»¨Ó¬O¥ÎCalculate¨Æ¥ó³B²z¡A¦ýµLªk§ä¥X¯u¥¿ÅܰʪºÀx¦s®æ¡A·|³y¦¨¸ê®Æ­«½Æªº¿ù»~


²{¦b§Ú·Q¨ìªº¿ìªk¬O¡G
²Ä¤@¦¸ÅÜ°Ê´N§âDÄæ¼g¤J²Ä¤@­Ó°}¦C
²Ä¤G¦¸ÅÜ°Ê´N§âÅܰʫ᪺DÄæ¼g¤J²Ä¤G­Ó°}¦C
¦A¤G­Ó°}¦C¤ñ¸û¡A¥H§ä¥X¬O­þ¤@­ÓÀx¦s®æ¦bÅÜ°Ê¡AÂǦ¹§ä¥X¨ä©ÒÄݪº»ù¦ì¡A¦A§â»ù¡B¶qÅܰʫ᪺¸ê®Æ¼g¤J¨ä»ù¦ì©ÒÄݪº¤u§@ªí

¦ý§Ú¹ï°}¦Cªº¼g§@¤è¦¡ÁÙ¤£¼ô±x¡A·j´M½×¾Â¤å³¹¡A¤]¨S¦³¬Û¦üªº½g´T¡A½Ð¦U¦ì¤j¤jÀ°¦£¡I¡I
©ÎªÌ¤j®a¦³§ó¦nªº¿ìªk¥i¥H§ä¥X¥D­nÅܰʪºÀx¦s®æªº¤èªkªº·Qªk¥i¥H´£¨Ñ°Ñ¦Ò¡A§Æ±æ¤j®aÀ°À°¦£¡AÁÂÁÂ!!
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¦^´_ 17# ko310kmo
[B2] = [B2](1, 1) = [B2].Cells(1, 1) = Rrange("B2").cells(1,1) => [B2].Offset( 0 , 0 ) => Rrange("B2")
[B2](2, 3) = [B2].Cells(2, 3) =  Rrange("B2").cells(2,3) => Rrange("B2").Offset( 1, 2 )=>Rrange("D3")

TOP

¦^´_ 10# GBKEE
¤j¤j¹ï©óµ{¦¡½Xªº¼gªk¡AÁÙ¦³´XÂI·Q½Ð±Ð


If IsEmpty(B) Then                      '¤ñ¹ï°}¦C¬°¸ê®Æ
        For Each E In Range("b2", Range("b2").End(xlDown))
            With Sheets(E.Text).Cells(Rows.Count, "j").End(xlUp)
                .Offset(1) = E(1, 2)        '°O¿ý ¦¨¥æ»ù
                .Offset(1, 1) = E(1, 3)     '°O¿ý ³æ¶q
                .Offset(1, 2) = Time        '°O¿ý ¦¨¥æ®É¶¡
            End With
        Next
E(1, 2)³o¼gªk¬O¤°»ò·N«ä?
    Else
        For i = 1 To UBound(A, 2)
            If A(1, i) <> B(1, i) Or A(2, i) <> B(2, i) Or A(3, i) <> B(3, i) Then ' ¼i¬ù»ùªº(¦¨¥æ»ù©Î¦¨³æ¶q)¦³ÅÜ°Ê
                With Sheets([B2].Cells(i, 1).Text).Cells(Rows.Count, "j").End(xlUp)
                    .Offset(1) = [B2].Cells(i, 2)       '°O¿ý¤U §Y®É¦¨¥æ»ù
                    .Offset(1, 1) = [B2].Cells(i, 3)    '°O¿ý¤U ³æ¶q
                    .Offset(1, 2) = Time
                End With
            End If
        Next
    End If
[B2].Cells(i, 3)
ÁöµM¬Ý¤F¤j¤j¶Kªººô§}ªº±Ð¾Ç
©Ò¥H¬O  range("B2").cells(i,3) ªº·N«ä¶Ü?
¬Ý¤F¦n¤[¡AÁÙ¬O¤£¤Ó¤F¸Ñ
½Ð¤j¤j¸ÑÄÀ¤@¤U¡AÁÂÁÂ!!!  
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¥»©«³Ì«á¥Ñ ko310kmo ©ó 2011-5-13 10:10 ½s¿è

¦^´_ 15# GBKEE

½Ð°Ý¤j¤j
        If Minute(Time) = Minute(t) Then
            Do While Minute(Time) = Minute(t)

³o¤G¦æªº·N«ä¬O
¤@ª½°µ¨ì³o¤@¤ÀÄÁ¹L§¹¹ï§a!
¦Ó§Ú­Ì«á­±¤S¼gApplication.OnTime Now + TimeValue("00:01:00"), "test2"
©Ò¥H·|¤£·|¬O¦]¬°³o¼Ë¡A¤~·|³y¦¨¤G¤ÀÄÁ°O¿ý¤@¦¸©O?

§Ú¦b·Q¬O¤£¬O¡A¤£¥Î¥[Application.OnTime
¦Ó§â¤j¤j­ì¥»ªºµ{¦¡³Ì«á¼gªº
Loop Until Time <= #1:30:00 PM#
§ï¦¨
Loop Until Time >= #1:30:00 PM#


loop until time<=1:30
°µ¨ì®É¶¡¤p©ó1ÂI30´N¸õ¥X¡A´ú¸Õªº®É¶¡¤@©w³£¬O¤p©ó1:30ªº¡A©Ò¥H¤~¸õ¶]¤@¹M¦Ó¤w¡A´N¸õ¥X


¤j¤j¡A¤µ¤é´ú¸Õµ²ªG¡A¥u­n§â<§ï¦¨>´N¨S¦³°ÝÃD¤F¡AÁÂÁ¤j¤jªºÀ°¦£»P­@¤ßÁ¿¸Ñ¡I¡I¡I:)
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 14# ko310kmo
¦pªG§Ú¬O¥ý°õ¦ætest1¦A°õ¦ætest2¡A¨S¦³³]©wtest3,³o¼Ë¤ÀÄÁ¸ê®Æ¥u·|§ó·s²Ä¤@¹M¡C
¤£­n¥Îtest3¤F
test2 ³Ì«á¥[¤W
If Time <= #1:30:00 PM# Then Application.OnTime Now + TimeValue("00:01:00"), "test2"
End Sub

TOP

¥»©«³Ì«á¥Ñ ko310kmo ©ó 2011-5-14 17:12 ½s¿è

¦^´_ 13# GBKEE

¤j¤j§Ú¤F¸Ñ¤F
§Ú¥»¨Ó¬O¥Î§Y®É¦¨¥æ»ù¡B³æ¶q
§Ú·Q¦A¥Î¤@­Ó¦¨¥æ¶q¨Ó¬ÝÅÜ°Ê



§Ú¦Û¦æ¨Ì§A´£¨Ñªº´X­Óµ{¦¡¡A­×§ï«á
Calculate¤w¸g¥i¥H¥¿½T¼g¤J¤F

²{¦b·|¥X²{ªº°ÝÃD¬O
¤ÀÄÁ¸ê®Æ¬O¢±¤ÀÄÁ§ó·s¤@¦¸

§Ú¬O¥ý°õ¦æ test1¡Aµ¥¥¦¶]§¹¦A°õ¦ætest3
³o¼Ë¬O¥i¥H¨C¤À§ó·sªº

¦pªG§Ú¬O¥ý°õ¦ætest1¦A°õ¦ætest2¡A¨S¦³³]©wtest3
³o¼Ë¤ÀÄÁ¸ê®Æ¥u·|§ó·s²Ä¤@¹M¡C

½Ð°Ý³o¨ì©³¬O¸Ó¦p¦ó­×§ï¤~¦n©O¡H
Àµ½Ð¤j¤j½ç±Ð¡I¡I¡I
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 11# ko310kmo
Worksheet_Calculate ¨Æ¥ó ¬O·í¤u§@ªíªº¥ô¤@­Ó¤½¦¡©Ò¶Ç¦^ªº¼Æ­È¦³§ïÅܮɧY°õ¦æªºµ{¦¡
©Ò¥H§AªþÀÉ ok.5.10 ªºµ{¦¡½X·|¨Ï¥Î°j°é±NRange("B2:B" & M)½d³ò¤ºªº¤u§@ªí¤@¤@ªº¼g¤J¸ê®Æ
½Ð¦b°Ñ¦Ò 10¼Ó ªºµ{¦¡½X¸Õ¸Õ¬Ý ¦ý¥ÎWorksheet_Calculate¨Ó°O¿ýÁÙ¬O·|¦³»~®tªº
¦p¦¨¥æ»ù¤£ÅÜ   00:10:01®Éªº¦¨¥æ¶q¬O 10  ¤U¤@¦¸ªº¦¨¥æ¦b 00:10:11 ®Éªº¦¨¥æ¶q ÁÙ¬O 10
¦p¦¹Worksheet_Calculate ¬O¤£·|°õ¦æªº »~®t´N²£¥Í  , ©Ò¥H«Øij¦³ ¦¨¥æ»ù¤Î¦¨¥æ¶q ªº®É¶¡Äæ ¨Ó°Ñ¦Ò.

TOP

¦^´_ 2# Hsieh

¤j¤j
§Ú­ì¥»ªºÀɦ³µy°µ­×§ï¡A¦ýÀ³¸Ó¤£­P©ó³y¦¨¤Ó¤jªº°ÝÃD
¦ý¤j¤jªºCalculate·|¦b¡y    If arr(I, 2) & arr(I, 3) <> rng(I, 2) & rng(I, 3) Then¡zµo¥Í¶À©³¡y«¬ºA¤£²Å¦X¡zªº¿ù»~¡H
¬ã¨s¤F¤@¤UÁÙ¬Oµo¤£¥X­ì¦]¡A§Æ±æ¤j¤j½ç±Ð 5.102.2.rar (22.2 KB)
¦]¬°¤@¯ë¼Ò²Õ¤¤¤w¦³¼g¤F¤@­Ó°}¦Car¡A©Ò¥H¦³±N¤j¤jªºar §ï¬°arr
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 5# ko310kmo

¤j¤j
Calculate¤w¸g·|¤@IJµo¡A´N¼g¤J¬Û¹ïªº¤u§@ªí¡A¤£·|Åý¨ä¥L¤u§@ªí­«½Æ¼g¤J¤F
¦ý¤ñ¸û§À³¡ªº¤u§@ªí·|¥X²{²Ä¤@­Ó¾ú¥v¦¨¥æ»ù¡B³æ¶q¬°¢¯ªºª¬ªp¡A·|³y¦¨«á­±¥|­Ó»ùªº§PÂ_°ÝÃD
¦Ó¥B¤ÀÄÁ¸ê®Æ·|­«½Æ¸õ¥X
¨C¤@¤ÀÄÁ¥u·|¦³¤@µ§¡A¦ý«o·|¦P¤@¤ÀÄÁ¥X²{¤G¡B¤Tµ§ªº°ÝÃD

§Ú¸ê®ÆÅã¥Üªº¤è¦¡¬O§Æ±æ¹³ªþÀÉ ok.5.10.rar (74.4 KB) ¡A¤]´N¬O¥u«eµo°Ýªº³o¼Ë
¨C¬í¬ö¿ý©Ò¥H±µ¨üªº­È¡A¦A¨C¤ÀÄÁµ²ºâ¥¦³o¤@¤À¤ºªº¶}¡B°ª¡B§C¡B¦¬¡B¦¨¥æ¶q
¦ý³oÀÉ·|¥X²{ªº°ÝÃD¬O¡A¥¦ªºCalculateµLªk±oª¾¬O­þ­ÓÀx¦s®æ¸õ°Ê
·|©Ò¥H¤u§@ªí³£¼g¤J¤@¦¸¡A·|³y¦¨¸ê®Æ¿ù»~ªº°ÝÃD

ÁÂÁ¤j¤jªºÀ°¦£¡I¡I¡I¡I¡I

1ª©.over.rar (27.56 KB)

50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-5-12 10:52 ½s¿è

¦^´_ 9# ko310kmo
If TheTime <> TimeSerial(Hour(Time), Minute(Time), 0) Then
Àɮפ@°õ¦æ®É TheTime <> TimeSerial(Hour(Time), Minute(Time), 0)
°õ¦æ¤§«á¦³³]©w TheTime = TimeSerial(Hour(Time), Minute(Time), 0)
¸g®É¶¡¨ì¤U¤@¤ÀÄÁ«á TheTime <> TimeSerial(Hour(Time), Minute(Time), 0)
ReDim AR(2 To Range("b2").End(xlDown).Row, 1 To 6)
±N AR°}¦C ­«·sªì©l¤Æ  (Âk¹s)
.Offset(1, 3).Resize(1, 6) = Application.Index(AR, E.Row - 1)  'Ū¨ú¤@¤ÀÄÁ¤ºªº¸ê®Æ
AR°}¦C¬O¬ö¿ý¤@¤ÀÄÁ¤º¦U¼i¬ù»ùªº ®É¶¡, ¶}, °ª, §C, ¦¬, ¶q
½Ð°Ý[B2]¬O¤°»ò·N«ä
http://forum.twbts.com/viewthread.php?tid=2811&from=favorites
*******************************************************
­«·s­×§ï¸Õ¸Õ¬Ý ¦ý»P§Aªº´Á±æ©|¦³¶ZÂ÷
  1. Private Sub Worksheet_Calculate()
  2. Dim E, i%
  3. On Error GoTo t '³B²z §Y®É¦¨¥æ»ù»P¦¨³æ¶q ½d³ò¨S¦³¿ù»~­È
  4. If Not Range("C2", Range("D2").End(xlDown)).SpecialCells(xlCellTypeFormulas, xlErrors) Is Nothing Then
  5. Exit Sub '¦¹Àɮתì¶}©l³sµ²®É§Y±Ò°Ê­«ºâ ->¦ý¬O©|¦³¥¼³sµ²¨ìªºÀx¦s®æ·|¶Ç¦^¿ù»~­È
  6. End If
  7. t:
  8. A = Application.Transpose(Range("C2", Range("D2").End(xlDown)).Value) '§Y®É¦¨¥æ»ù»P¦¨³æ¶q½d³ò°}¦C
  9. If TheTime <> TimeSerial(Hour(Time), Minute(Time), 0) Then '³]©w¨C¤ÀÄÁ¾ã
  10. ReDim AR(2 To Range("b2").End(xlDown).Row, 1 To 6) '°}¦C ­«·sªì©l¤Æ (Âk¹s)
  11. ¶}½L»ù = Empty 'Åܼƪì©l¤Æ (Âk¹s)
  12. Ex
  13. If Not IsEmpty(B) Then
  14. For Each E In Range("b2", Range("b2").End(xlDown))
  15. Sheets(E.Text).Cells(Rows.Count, "j").End(xlUp).Offset(, 6) = B(1, E.Row - 1) '¤@¤ÀÄÁµ²§ô®Éªº»ù®æ
  16. Next
  17. End If
  18. TheTime = TimeSerial(Hour(Time), Minute(Time), 0)
  19. Else
  20. Ex
  21. End If
  22. If IsEmpty(B) Then '¤ñ¹ï°}¦C¬°¸ê®Æ
  23. For Each E In Range("b2", Range("b2").End(xlDown))
  24. With Sheets(E.Text).Cells(Rows.Count, "j").End(xlUp)
  25. .Offset(1) = E(1, 2) '°O¿ý¤U ¦¨¥æ»ù
  26. .Offset(1, 1) = E(1, 3) '°O¿ý¤U ³æ¶q
  27. .Offset(1, 2).Resize(1, 6) = Application.Index(AR, E.Row - 1) 'Ū¨ú¤@¤ÀÄÁ¤ºªº¸ê®Æ
  28. End With
  29. Next
  30. Else
  31. For i = 1 To UBound(A, 2)
  32. If A(1, i) <> B(1, i) Or A(2, i) <> B(2, i) Then ' ¼i¬ù»ùªº(¦¨¥æ»ù©Î¦¨³æ¶q)¦³ÅÜ°Ê
  33. With Sheets([B2].Cells(i, 1).Text).Cells(Rows.Count, "j").End(xlUp)
  34. .Offset(1) = [B2].Cells(i, 2) '°O¿ý¤U §Y®É¦¨¥æ»ù
  35. .Offset(1, 1) = [B2].Cells(i, 3) '°O¿ý¤U ³æ¶q
  36. .Offset(1, 2).Resize(1, 6) = Application.Index(AR, i) 'Ū¨ú¤@¤ÀÄÁ¤ºªº¸ê®Æ
  37. End With
  38. End If
  39. Next
  40. End If
  41. B = A
  42. End Sub
  43. Sub Ex() 'Sheet1ªºµ{¦¡½X §Aµo°Ýªº¨º½g [dde tick¸ê®ÆÂà´«¤ÀÄÁ¸ê®Æ]
  44. Dim i%
  45. If IsEmpty(¶}½L»ù) Then
  46. ReDim ¶}½L»ù(2 To UBound(AR))
  47. For i = 2 To [B1].End(xlDown).Row
  48. ¶}½L»ù(i) = Cells(i, "C")
  49. Next
  50. End If
  51. For i = 2 To [B1].End(xlDown).Row
  52. If TheTime <> TimeSerial(Hour(Time), Minute(Time), 0) Then
  53. AR(i, 1) = Time 'TimeSerial(Hour(Time), Minute(Time), 0) '®É¶¡
  54. AR(i, 2) = ¶}½L»ù(i) '¨C¤ÀÄÁ¶}½L»ù
  55. AR(i, 3) = Cells(i, "C") '¨C¤ÀÄÁªº³Ì°ª»ù
  56. AR(i, 4) = Cells(i, "C") '¨C¤ÀÄÁªº³Ì§C»ù
  57. AR(i, 6) = Cells(i, "D") '¨C¤ÀÄÁªº¦¨¥æ¶q
  58. Else
  59. AR(i, 1) = Time
  60. AR(i, 3) = IIf(Cells(i, "C") > AR(i, 3), Cells(i, "C"), AR(i, 3)) '¨C¤ÀÄÁªº³Ì°ª»ù
  61. AR(i, 4) = IIf(Cells(i, "C") < AR(i, 4), Cells(i, "C"), AR(i, 4)) '¨C¤ÀÄÁªº³Ì§C»ù
  62. 'AR(i, 5) = Cells(i, "C") '¨C¤ÀÄÁªº¦¬½L»ù
  63. AR(i, 6) = AR(i, 6) + Cells(i, "D") '¨C¤ÀÄÁªº¦¨¥æ¶q
  64. End If
  65. Next
  66. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³´¼¼z¤~¯à¤À¿ëµ½´c¨¸¥¿¡F¦³Á¾µê¤~¯à«Ø¥ß¬üº¡¤H¥Í¡C
ªð¦^¦Cªí ¤W¤@¥DÃD