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

[µo°Ý] ½Ð°Ý¦p¦ó§Q¥ÎDDE´£¨Ñªº®É¶¡¼Æ¾Ú©w´Á¬ö¿ý¦bexcel¬¡­¶Ã¯

[µo°Ý] ½Ð°Ý¦p¦ó§Q¥ÎDDE´£¨Ñªº®É¶¡¼Æ¾Ú©w´Á¬ö¿ý¦bexcel¬¡­¶Ã¯

¦b¥»½×¾Â¬Ý¨ì³\¦h§Q¥Î¹q¸£¨t²Î®É¶¡¨Ó©w´Á¬ö¿ýªÑ¥«¼Æ¾Ú¡A¥Ø«e¨Ï¥ÎPrivate Sub Worksheet_Calculate()±µ¦¬¼Æ¾Ú¡A¦]¬°¹q¸£¨t²Î®É¶¡»P¬Ý½L³nÅé®É¶¡¤£¤@­P¡C
¦pªG·Q§Q¥Î¬Ý½L³nÅéÅã¥Ü¦b¬¡­¶Ã¯¤Wªº®É¶¡¨Ò¦p094500¡B104500¡B114500¡B124500¡B134500µ¥®É¶¡¨Ó°O¿ýªÑ»ù¶}½L¡B³Ì°ª¡B³Ì§C¡B¦¬½L¡A¸Ó¦p¦ó§Q¥Î¥¨¶°¼g¤U¨Ó°O¿ý¡C
ÁÂÁ¦U¦ì­@¤ßÆ[¬Ýµo°Ý¡C
¤H¥Í¥u¦³¤T¤Ñ¡A¥u¦³¬¡¦b¤µ¤Ñ³Ì½ñ¹ê

¦^´_ 1# barrykuo


    ¥Îapplication.ontime¥i¥H¹F¦¨§A­nªº¥\¯à¡A¦ý¯à§_ªþ­ÓÀÉ¡Ashow¥X§Aªºªí®æ¤º®e¡A¥H«K¤j®aÀ°§A³]©w¡C

TOP

¦^´_ 1# barrykuo
"¦pªG·Q§Q¥Î¬Ý½L³nÅéÅã¥Ü¦b¬¡­¶Ã¯¤Wªº®É¶¡¨Ò¦p094500¡B104500¡B114500¡B124500¡B134500µ¥®É¶¡¨Ó°O¿ýªÑ»ù¶}½L¡B³Ì°ª¡B³Ì§C¡B¦¬½L¡A¸Ó¦p¦ó§Q¥Î¥¨¶°¼g¤U¨Ó°O¿ý¡C"
§PÂ_®É¶¡ (Time) §ï¥H§PÂ_¡y¬Ý½L³nÅéÅã¥Ü¦b¬¡­¶Ã¯¤Wªº®É¶¡¡z«K¦æ¤F¡C

TOP

¦^´_ 3# c_c_lai
ÁÂÁÂowen06¡BC_C_Lai¤j¤j§Ö³t¼ö¤ß¦^´_¡Aªþ¤Wexcel¤å¥ó¡A¬Q±ß¼gªº¡A¦]¬°¤£¤Ó·|¼g¡A©Ò¥H½Ð±Ð³o¼Ë¥i¥H¶Ü?¬O§_§ó¦³¤è«Kªº§PÂ_¡C
­pºâA02.rar (116.31 KB)
¤H¥Í¥u¦³¤T¤Ñ¡A¥u¦³¬¡¦b¤µ¤Ñ³Ì½ñ¹ê

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2014-7-2 10:56 ½s¿è

¦^´_ 4# barrykuo
§A¸ÕµÛ±N
  1.     If oneH >= 1 Then
  2.         MsgBox "I got it!"      '  §A±ý¼g¤Jªº¸ê®Æ¤º®e
  3.     End If      
½Æ»s¥N½X
´«¦¨³o­Ó´ú¸Õ¨Ò¤l¡A¸ÕµÛ§ï¦¨§A©Ò­nªº¶¡¶Z®É¬q¡G
  1. Sub Ex()
  2.     Dim MyStr
  3.    
  4.     '  ³]©w®É¶¡®æ¦¡¬° HH:MM:SS
  5.     MyStr = Format(Sheets("§Y®É«ü¼Æ").Range("C3"), "00:00:00")

  6.     '  ¦¹¨Ò¬°¨C¹j 5 ¤ÀÄÁ°õ¦æ¤@¦¸ (5 x 60)
  7.     If (Minute(MyStr) * 60 + Second(MyStr)) Mod 300 = 0 Then
  8.         MsgBox "I got it!"
  9.     End If
  10. End Sub
½Æ»s¥N½X
¦p¦¹«K¦¨¤F§A©Ò­nªºÃöÁä©Ê¤º®e¤F¡C

TOP

¦^´_ 4# barrykuo
¤S¡B­pºâA02.rar ¤@¶}±Ò·|¦³¿ù»~°T®§
¬O¦]¬°§A¤Ö«Ø¥ß¤@­Ó¤u§@ªí³æ "5K"¡C

TOP

¦^´_ 6# c_c_lai
C_C_lai¤j¤j¡I
¹ï¤£°_§Ñ°O§R°£5K¬ÛÃö±Ô­z¡C
±z´£ªº¤è®×¬O¾ã°£§PÂ_¾l¼Æ¬°¹s®É¡A¶i¦æ°O¿ý¡C
§Úªº°ÝÃD¬ODDE¼Æ¾Ú³s½u¶i¨Ó¡A¸g¹LÆ[¹î¦³®É¤£¤@©w¥¿ÂI·|¦³¼Æ¾Ú¡A©Ò¥H¤£¤@©w¯à¾ã°£¡A¨Ò¦p¡G09:44:58¥X²{¤@¤ñ¸ê®Æ¡AµM«á¦b09:45:01¤~¥X²{¥t¤@µ§¸ê®Æ¡A³o®É«e¤@¤p®Éªº¼Æ¾ÚÀ³¸Ó¥u¨ì09:44:58¥²¶·§¹¦¨²Î­p¡C
¤~¿é¾Ç²L¡AÁÂÁ±z­@¤ß±Ð¾É¡I
¤H¥Í¥u¦³¤T¤Ñ¡A¥u¦³¬¡¦b¤µ¤Ñ³Ì½ñ¹ê

TOP

¦^´_ 7# barrykuo
¨º¥u¦n°t¦X¹ê»Úµo¥Íªº¼Æ¾Ú¥h¾÷°Ê§PÂ_¤F¡C

TOP

¦^´_ 8# c_c_lai
ÁÂÁÂc_c_lai¤j¤j¼ö¤ß«ü¾É!
¤H¥Í¥u¦³¤T¤Ñ¡A¥u¦³¬¡¦b¤µ¤Ñ³Ì½ñ¹ê

TOP

¤j®a¦n¡A§Ú¦³¸òbarrykuo¤j¤j¦³¬Û¦Pªº°ÝÃD¡A´N¬O·QÂ^¨úDDEªº"¾ã®É"¸ê®Æ( ex ¡G00:01:00¡B00:02:00....)
¡A¦]¬°§Ú¹ïVBA¨S¦³°ò¦¡A¥u¬Oª¦¤å§ì¾A¥Îµ{¦¡¨Ó­×§ï¡C¦ý¦b¾ã®É¸ê®ÆÂ^¨ú¤W¤´µLªkÀò±o¸Ñ¨M¡C
¥Ø«e§Ú§â
Application.OnTime Now + TimeValue("00:00:0" & 59 - Second(Time) Mod 1), "¦Û°Ê°O¿ý"   '¨C1¤ÀÄÁ»¼°j¤@¦¸
­×§ï¦¨³o¼Ë¡A¦ý¦b°O¿ý¸ê®Æ®É¡AµLªk±o¨ì"·Ç®É"°O¿ý¡AÁÙ¥X²{1¤À¤º°O¿ý2¦¸¡B©ÎªÌ¹j¤F´X¤À³£¨S°ÊÀR....¡C

¦]¬°§ÚªºÅv­­¤£¯à¤U¸übarrykuo¤j¤jµ{¦¡¨Ó¤ñ¸û¡A©Ò¥H«¨¥X§Úªºµ{¦¡¡A½Ð±Ð¦U¦ì«e½ú¦p¦ó¸Ñ¨M¡C
Public uMode&, StartTime, EndTime

Sub ¦@¥Î°Ñ·Ó()
StartTime = "08:29:30"  '¶}½L®É¶¡¡]´£¦­¤Q¬í¶}©l¡A¤~¥i°O¿ý¶}½L¶q»ù¡^
EndTime = "23:59:59"    '´ú¸Õ®É¶¡¨Ï¥Î
End Sub

Sub ¦Û°Ê°O¿ý()
Dim MyBook As Workbook, MySht As Worksheet, xEnd As Range
'--------------------------------------------------------------------------
If uMode = 0 Then Exit Sub
If Time > TimeValue(EndTime) Then Exit Sub '¦¬½L®É¶¡¥H«á¤£°õ¦æ
Set MyBook = ThisWorkbook
Set MySht = MyBook.Sheets("DDE")
'Åýµ{¦¡¥u¦b¥»Àɮתº¡e«ü©w¤u§@ªí¡f¤¤°õ¦æ¡A§_«h·|±N¸ê®Æ¼g¨ì¨ä¥¦¤u§@ªí
MySht.Range("AA6") = Time '·í«e®É¶¡¡]®É¶¡½Xªí¡^
'----------------------------------------------------------
If Val(MySht.Range("AA11").Value) > 0 Then
   Set xEnd = MySht.Range("A65536").End(xlUp)(2)
   If xEnd.Row < 12 Then Set xEnd = MySht.Range("A12")
   MySht.Range("A11:Z11").Value = MySht.Range("A6:Z6").Value
   xEnd.Resize(1, 26).Value = MySht.Range("A2:Z2").Value
   xEnd(1, 27).Value = Time
   '------------------------------------------------
   If ActiveSheet.Name = MySht.Name And xEnd.Row > 20 Then
      ActiveWindow.ScrollRow = xEnd.Row - 8 'Åý³Ì·s¸ê®Æ«O«ù¦b¥i¨£µøµ¡¤¤
   End If
   ThisWorkbook.Save   '¦sÀÉ
End If
'----------------------------------------------------------
'¨C¤@¤À»¼°j¤@¦¸
Application.OnTime Now + TimeValue("00:00:0" & 59 - Second(Time) Mod 1), "¦Û°Ê°O¿ý"
End Sub

Sub ¶}©l°õ¦æ()
Call ¦@¥Î°Ñ·Ó
uMode = 1
Call ¦Û°Ê°O¿ý
End Sub

Sub °±¤î°õ¦æ()
uMode = 0
End Sub

TOP

        ÀR«ä¦Û¦b : ¯à¥I¥X·R¤ß´N¬OºÖ¡A¯à®ø°£·Ð´o´N¬O¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD