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

DDE Â^¨ú¤ÀÄÁ³Ì°ª³Ì§C

DDE Â^¨ú¤ÀÄÁ³Ì°ª³Ì§C

ª©¤j±z¦n ·Q½Ð±Ð±z¦³ÃöDDE¨ú³Ì°ª¥H¤Î³Ì§C»ù®æªº¼gªk ¦bEXCELªí®æ¤¤ B5¬°DDEªº®É¶¡¿é¤J B6¬°DDEªº»ù®æ¿é¤J­Y·QÅý¥L¨C¤ÀÄÁ³£¯à§ì¥X³Ì°ª»P³Ì§C»ù®æÅã¥Ü¦bD8©ME8Ä椤¨Ã¨Ì§Ç¦V¤U  ¥BB5®É¶¡¿é¤Jªº³¡¤À¬O¸g¥Ñµ{¦¡­p¼Æ©ÒÅã¥Ü¥X¨Óªº¤£¬O¸g¥ÑDDEÁpµ²¡@·Q½Ð±Ð¤@¤U¸Ó«ç»ò¼g ³Â·Ð±z¤F ·PÁ±z!!

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-6-21 11:20 ½s¿è

¦^´_ 1# vzcen
¨S¥Î¹LDDE¡A¶È¨Ñ°Ñ¦Ò¡C
  1. Private gbStart As Boolean
  2. Private recTime
  3. Private recValue
  4. Private Sub Worksheet_Calculate()
  5.     Dim ddeValue
  6.    
  7.     If gbStart Then
  8.         ddeValue = [B6].Value
  9.         If IsEmpty(recValue) Then recTime = Time: recValue = ddeValue
  10.         
  11.         If Minute(recTime) = Minute(Time) Then
  12.             If ddeValue > recValue Then recTime = Time: recValue = ddeValue
  13.         Else
  14.             '¬ö¿ý®É¶¡¦bDÄæ³Ì«á¤@¦C¤U¤è
  15.             Cells(Rows.Count, "D").End(xlUp).Offset(1).Value = recTime
  16.             '¬ö¿ý»ù®æ¦bEÄæ³Ì«á¤@¦C¤U¤è
  17.             Cells(Rows.Count, "E").End(xlUp).Offset(1).Value = recValue
  18.             recTime = Time: recValue = ddeValue
  19.         End If
  20.     End If
  21.    
  22. End Sub
  23. '¥i«Ø¥ß«ö¶s¶}©l©Îµ²§ô
  24. Private Sub StartRecordData()
  25.     gbStart = True
  26. End Sub
  27. Private Sub StopRecordData()
  28.     gbStart = False
  29.     recTime = Empty
  30.     recValue = Empty
  31. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-6-24 16:18 ½s¿è

¦^´_ 1# vzcen
³oDEE¤u§@ªíª«¥óªºµ{¦¡½X
  1. Option Explicit
  2. Private Sub Worksheet_Calculate()
  3.     Dim Rng As Range
  4.     Static Msg As Boolean    '¥H Static ³¯­z¦¡«Å§iªºÅܼơA¦bµ{¦¡°õ¦æ´Á¶¡¡A·|¤@ª½«O¯d¤º®e¡C
  5.     If Weekday(Date, vbMonday) > 5 Or Time < #9:00:00 AM# Or Time > #1:30:00 PM# Then Exit Sub  '«DÀç·~¤é ©Î «DÀç·~®É¶¡
  6.     If Msg = False Then
  7.         ²M°£Â¸ê®Æ
  8.         Msg = True
  9.     End If
  10.     With Cells(Rows.Count, "C").End(xlUp)
  11.         If .Row = 7 Then
  12.             Set Rng = .Offset(1)
  13.         Else
  14.             Set Rng = .Cells
  15.         End If
  16.     End With
  17.     If Rng = "" Or Rng.Text <> Format([b5], "hh:mm") Then
  18.         If Rng <> "" Then Set Rng = Rng.Offset(1)
  19.         Rng = Format([b5], "hh:mm")
  20.         Rng(1, 2) = [B6].Text
  21.         Rng(1, 3) = [B6].Text
  22.     ElseIf Rng.Text = Format([b5], "hh:mm") Then
  23.         If [B6] > Rng(1, 2) Then Rng(1, 2) = [B6].Text
  24.         If [B6] < Rng(1, 3) Then Rng(1, 3) = [B6].Text
  25.     End If
  26. End Sub
  27. Private Sub ²M°£Â¸ê®Æ()
  28.     On Error GoTo Er
  29.     If [Àç·~¤é] <> Date Then            'Àˬd ©w¸q¦WºÙ:"Àç·~¤é"ªº­È
  30.         Me.Names.Add "Àç·~¤é", Date     '©w¸q¦WºÙ:"Àç·~¤é"ªº­È¬°·í¤é
  31.         If Weekday(Date, vbMonday) <= 5 Then Range([C8], [E8].End(xlDown)).Clear 'Àç·~¤é
  32.     End If
  33.     Exit Sub
  34. Er:  '³B¸Ì: ¨S¦³©w¸q¦WºÙ:"Àç·~¤é"ªº¿ù»~
  35.      Me.Names.Add "Àç·~¤é", Date        '©w¸q¦WºÙ:"Àç·~¤é"ªº­È¬°·í¤é
  36.      Resume Next                        '¦^¨ì¿ù»~ªº¤U¤@­Óµ{¦¡½X:Ä~Äò°õ¦æ
  37. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

«D±`·PÁ±jªÌª©¤j­Ìªº«ü¾É ¬Q±ßª¦¤åª¦¨ì¥b©]¨âÂI¦h ÁÙ¬Oª¦¤£¥X¤@­Ó©Ò¥HµM¨Ó §Ú¯uªº¤Ó·M¬N¤F... ³o¨â¤Ñ§Ú·|´ú¸Õ¤@¤U «áÄò¦A¸òª©¤j­Ì³ø§iª¬ªp»P½Ð¯q ·PÁÂ!!!!!!

TOP

GBKEEª©¤j±z¦n §Ú­è§ï¤F¤@¤UÀç·~ªº®É¶¡´ú¸Õ¤F¤@¤U²{¦b³sµ²ªºDDE³ø»ù µo²{¤@­Ó°ÝÃD·Q½ÐªO¤j¸Ñ´b ´N¬O¥Ñ©ó¦U®a¨t²Îªº³ø»ù®É¶¡®æ¦¡¤£¦P ¨Ò¦p:°²³]²{¦b¬O10:29:03   ¦ýDDE ³sµ²¨ìB5ªº¤º®e·|Åã¥Ü¦¨102903......µ²ªG´ú¸Õ«á ¥u­nDDE¤@¸õ°Ê ´N·|¦bCDEÄæ¤@ª½©¹¤U¬ö¿ý..¤£¬O¨C¤ÀÄÁ¬ö¿ý¤@¦¸³Ì¤j³Ì¤p­È...©Ò¥H·Q½Ð±Ðª©¤j ¦bB5ªº®É¶¡Åã¥Ü ¸Ó«ç»òÅý¥¦³z¹Lµ{¦¡Åã¥Ü®É¶¡ ²Î¤@¥Îªº¬O¹q¸£ªº¨t²Î®É¶¡.... ÁÂÁ±z¤F ~

TOP

ÁÙ¦³¤@­Ó¤p°ÝÃD ¤£¦n·N«ä ­n¦A³Â·Ð±z¤@¤U ´N¬O»¡ ·í¤U¤@¤ÀÄÁ­Y¨S¦³¥X²{¤j©ó©Î¤p©ó¤W¤@¤ÀÄÁªº³Ì¤j­È³Ì¤p­È ¨º»ò¦n¹³´N¤£·|Ä~Äò©¹¤U¸õ°Ê Á|¨Ò¨Ó»¡ C8Àx¦s®æ10:01.. D8Àx¦s®æ³Ì¤j­È100... E8Àx¯Â®æ³Ì¤p­È50 ... ­YB6Àx¦s®æªº»ù®æ¨S¦³¸õ¶W¹L100¥H¤W,50¥H¤U   ¨º»ò¦n¹³´N¥u·|°±¯d¦bD8 E8 ¤§¤¤ ª½¨ìB6¤j©ó100©Î¤p©ó50  ¤~·|§ó·s¼Æ¾Ú....Àµ½Ð¤j¤j¸Ñ´b ¦p¦ó¯à¨C¤@¤ÀÄÁ¥ÑDÄæ¤ÎEÄæ¨Ì§Çªº©¹¤UÅã¥Ü¨ú±o¨C¤ÀÄÁªº³Ì¤j­È¸ò³Ì¤p­È...ÁÂÁ±z¤F~~

TOP

¦^´_ 6# vzcen
³o°ÝÃD½ÐªþÀɬݬÝ

5# ¥i¦p¹Ï¥Ü­×§ï®æ¦¡


·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

ª©¤j±z¦n ÁÂÁ±zªº¦^ÂÐ §Ú·|¥ý¸ÕµÛ§ï¬Ý¬Ý ¤£¹L¦³­Ó¤p°ÝÃD·Q½Ð±Ðª©¤j ¥Ñ©óµ{¦¡¸Ì­±¦³­­©w"«DÀç·~¤é" ¨º²{¦b¬O©P¤»¤éªº±¡ªp ­Y§Ú­n®³±¼"«DÀç·~¤é"ªºµ{¦¡½X ¬O¤£¬O¥u­n±N05¦æªº If Weekday(Date, vbMonday) > 5 Or Time < #9:00:00 AM# Or Time > #1:30:00 PM# Then Exit Sub  '«DÀç·~¤é ©Î «DÀç·~®É¶¡>>>>>§ï¦¨  If  Time < #9:00:00 AM# Or Time > #1:30:00 PM# Then Exit Sub  '«DÀç·~¤é ©Î «DÀç·~®É¶¡       §ï§¹«á§Ú¬O¤£¬O´N¥i¥H¦b¶g¤»¤éªº®É¶¡ ¥Î¤â°Êªº¤è¦¡ ¿é¤J DDEÁpµ²ªºÀx¦s®æB5¸òB6......Åýµ{¦¡¶]¶]¬Ý¶i¦æ´ú¸Õ    .....Àµ½Ð¤j¤j¸Ñ´b ³Â·Ð±z¤F ÁÂÁ±z~

TOP

¦^´_ 8# vzcen
¤µ¤Ñ¬O¶g¤é,¸Õªº¦p¦ó!
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¤ÀªRµ{¦¡½X·í¤¤..

¤£¹Lª©¤j°Ýªº°ÝÃD¸Ì­±  

¦³®É­Ô·|¥]§t¬P´Á¤»¤]·|¶}½L³á...@@"  

³o¼Ë¤l §A¨º­Ó¯S®íªº¥æ©ö¤é  ´N¨S¿ìªk°O¿ý¤F

TOP

        ÀR«ä¦Û¦b : «Ý¤H°h¤@¨B¡A·R¤H¼e¤@¤o¡A´N·|¬¡±o«Ü§Ö¼Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD