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

[µo°Ý] DDE°O¿ý¸ê®Æ¨D§U

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-4-24 04:36 ½s¿è

¦^´_ 20# n8975067
  1. Sub updateFollow()
  2.     Dim Rng As Range
  3.    
  4.     With Sheet2
  5.         '  Set Rng = .Range("A" & .Range("A" & .Rows.Count).End(xlUp).Row + 1)
  6.         '
  7.         '  Rng = Sheet1.[c2]
  8.         '  Rng.Offset(, 1) = Sheet1.[d2]
  9.         '  Rng.Offset(, 2) = Sheet1.[e2]
  10.         '  Rng.Offset(, 3) = Sheet1.[f2]
  11.         '  Rng.Offset(, 4) = Sheet1.[g2]
  12.         '  Rng.Offset(, 5) = Sheet1.[h2]
  13.         '  Rng.Offset(, 6) = Sheet1.[i2]
  14.         '  Rng.Offset(, 7) = Sheet1.[j2]
  15.         '  Rng.Offset(, 8) = Sheet1.[k2]
  16.         '  Rng.Offset(, 9) = Sheet1.[l2]
  17.         '  ¤W­±¤§±Ô­zªí¹F»P¤U¦Cªº±Ô­zµ²ªG¬O¤@¼Ëªº¡A®t²§¥u¦b©ó¨Ï¥Î»yªk¤§¥©§®¤£¦P¡C
  18.         Set Rng = .Range("A" & .Range("A" & .Rows.Count).End(xlUp).Row + 1).Resize(1, 10)
  19.         
  20.         Rng(1) = Sheet1.[c2]
  21.         Rng(2) = Sheet1.[d2]
  22.         Rng(3) = Sheet1.[e2]
  23.         Rng(4) = Sheet1.[f2]
  24.         Rng(5) = Sheet1.[g2]
  25.         Rng(6) = Sheet1.[h2]
  26.         Rng(7) = Sheet1.[i2]
  27.         Rng(8) = Sheet1.[j2]
  28.         Rng(9) = Sheet1.[k2]
  29.         Rng(10) = Sheet1.[l2]
  30.     End With
  31.    
  32.     '  Application.OnTime Now + 60 / 86400#, "ThisWorkbook.updateFollow"    '  ¨C¤@¤ÀÄÁ©I¥s ¤@¦¸
  33.     Application.OnTime Now + 300 / 86400#, "ThisWorkbook.updateFollow"      '  ¨C¤­¤ÀÄÁ©I¥s ¤@¦¸
  34. End Sub
½Æ»s¥N½X
¤w¶Çµ¹§A¤F¡I
¦b Sheet1 ¥[¤W¤F±Ò°Ê«ö¶s¡A¤è«K§A°õ¦æ¬d®Ö¡C

TOP

¦^´_ 21# c_c_lai
³ø§ic_c_¤j¡A¤µ¤Ñ¸Õ¥Î¡A¤w¸g¥i¥H°O¿ý¤F¡A¦ý¬O§_¬O­n«ö«ö¶s¤~·|±Ò°Ê?
¥t¥~§Ú·Q­n¦b¦­¤W0845®É¡A¨C¹j¾ã¼Æ5¤ÀÄÁ¶}©l°O¿ý(¨Ò¦p0850 0900)¡A§Ú¦³¬Ý¨ì±zªº¥t¤@½g¤å³¹¡A¤W­±¦³´£¨ì¤èªk¡A¬O·Ó¨º¤W­±ªº»yªk¶Ü?



PS:¤j¤j¡A¦³­Ó¦a¤è§Ú¤£¤Ó¤F¸Ñ¡A¬°¦ó·|¦³¤­¤ÀÄÁ¸ò¤@¤ÀÄÁªº©I¥s©O?

TOP

¦^´_  c_c_lai
³ø§ic_c_¤j¡A¤µ¤Ñ¸Õ¥Î¡A¤w¸g¥i¥H°O¿ý¤F¡A¦ý¬O§_¬O­n«ö«ö¶s¤~·|±Ò°Ê?
¥t¥~§Ú·Q­n¦b¦­¤W084 ...
n8975067 µoªí©ó 2013-4-25 14:47

¦]¬°§Ú­n´ú¸Õ§A©Ò»¡ªº°ÝÃDÄpµ²¡A¬°¸`¬Ù´ú¸Õ®É¶¡¡A
©Ò¥H§Ú¥H¨C¹j¤@¤ÀÄÁ¤@¦¸¡A¨ÓÆ[¹î°õ¦æµ²ªG¤§¬G¡C
«ö¶s¤§¥Î·N¡A¬O¦b©ó·í§A­n¶}©l°õ¦æ®É¤è«K§A±Ò¥Î¡A
¦Ó¤£¶·¦A¨ìµ{¦¡°Ï±Ò°Êµ{¦¡¡C
¦p¦¹»¡©ú¥i¥H¶Ü¡H

TOP

¦^´_ 22# n8975067
¦pªG§A·Q­n¨t²Î¦Û°Ê±±ºÞ¶}½L¡B»PÃö½L¡A
¨º»ò§A«K­n°Ñ¦Ò¨ä¥L½d¨Ò¤F¡I

TOP

¦^´_ 24# c_c_lai
c_c_¤j¡A§Ú¦³§ä¨ì¤@½g½d¨Ò
http://forum.twbts.com/viewthrea ... a=pageD9&page=3
¨º§Ú¬O§_¯à±N¶}½L¦¬½L¨º¦æ²¾´Ó¹L¨Ó´N¥i¥H¨Ï¥Î?

TOP

¦^´_ 25# n8975067
  1. Option Explicit
  2. Dim timerEnabled As Boolean    ' §P©w¶}±Ò¥»¤u§@ªí³æªº®É¬q¬O§_¬°¶}½L«e±Ò°Ê¡C

  3. Private Sub Workbook_Open()
  4.     timerEnabled = False
  5.      
  6.     Call timerStart            ' µ{¦¡¤@±Ò©l¡A«K¥h¦Û°Ê°õ¦æ timerStart
  7. End Sub

  8. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  9.     On Error Resume Next
  10.     Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.RTimer", , False
  11.    
  12.     Me.Save
  13. End Sub

  14. Sub timerStart()   
  15.     If timerEnabled Then
  16.         ' ²Ä¤G¦¸(§t)¥H«á§¡¥H³]©w¤§ "¶¡¹j®É¬q" ¨Ó³B²z°õ¦æ§Çªº§@·~¡C
  17.         Application.OnTime (Now + TimeValue("00:05:00")), "ThisWorkbook.updateFollow"    '  ¨C¹j¤­¤ÀÄÁ°õ¦æ¤@¦¸
  18.     Else
  19.         timerEnabled = True
  20.         
  21.         ' ±N²Ä¤@¦¸±Ò°Ê®É¶¡§ó§ï¬°³]©w "¶}½L®É¶¡"«e¡A¦pªG¶}±Ò Excel ®É¡A¤w¸g¹L¤F³]©w "¶}½L®É¶¡"¡A«h¤@¶i¤J¨t²Î§Yª½±µ¥h°õ¦æ¬ö¿ý§@·~¡C
  22.         If (TimeValue(Now) <= TimeValue("08:45:00")) Then
  23.             Application.OnTime (TimeValue("08:45:00")), "ThisWorkbook.updateFollow"
  24.         Else
  25.             ' ¨t²Î­è³s¤W DDE ¦Ü¸ê®Æ¶×¤JExcel¤u§@ªí³æ¡A¶·¦³¤@­Ó½w½Ä®É¬q¡A
  26.             ' ³o®É¦pªG°¨¤W¥h§ì¨úDDE¸ê®Æ¡A·|¦³«¬ºA¤£²Åªº¿ù»~°T®§²£¥Í¡A¨Ã¤¤Â_°õ¦æ§Çªº§@·~¡C
  27.             Application.OnTime (Now + TimeValue("00:00:05")), "ThisWorkbook.updateFollow"
  28.         End If
  29.     End If
  30. End Sub

  31. Sub updateFollow()
  32.     Dim Rng As Range
  33.    
  34.     On Error Resume Next
  35.     If (TimeValue(Now) < TimeValue("08:45:00") Or TimeValue(Now) > TimeValue("13:45:00")) Then Exit Sub

  36.     With Sheet2
  37.         '  Set Rng = .Range("A" & .Range("A" & .Rows.Count).End(xlUp).Row + 1)
  38.         '
  39.         '  Rng = Sheet1.[c2]
  40.         '  Rng.Offset(, 1) = Sheet1.[d2]
  41.         '  Rng.Offset(, 2) = Sheet1.[e2]
  42.         '  Rng.Offset(, 3) = Sheet1.[f2]
  43.         '  Rng.Offset(, 4) = Sheet1.[g2]
  44.         '  Rng.Offset(, 5) = Sheet1.[h2]
  45.         '  Rng.Offset(, 6) = Sheet1.[i2]
  46.         '  Rng.Offset(, 7) = Sheet1.[j2]
  47.         '  Rng.Offset(, 8) = Sheet1.[k2]
  48.         '  Rng.Offset(, 9) = Sheet1.[l2]
  49.         '  ¤W­±¤§±Ô­zªí¹F»P¤U¦Cªº±Ô­zµ²ªG¬O¤@¼Ëªº¡A®t²§¥u¦b©ó¨Ï¥Î»yªk¤§¥©§®¤£¦P¡C
  50.         Set Rng = .Range("A" & .Range("A" & .Rows.Count).End(xlUp).Row + 1).Resize(1, 10)
  51.         
  52.         Rng(1) = Sheet1.[c2]
  53.         Rng(2) = Sheet1.[d2]
  54.         Rng(3) = Sheet1.[e2]
  55.         Rng(4) = Sheet1.[f2]
  56.         Rng(5) = Sheet1.[g2]
  57.         Rng(6) = Sheet1.[h2]
  58.         Rng(7) = Sheet1.[i2]
  59.         Rng(8) = Sheet1.[j2]
  60.         Rng(9) = Sheet1.[k2]
  61.         Rng(10) = Sheet1.[l2]
  62.     End With
  63.    
  64.     If timerEnabled Then Call timerStart
  65. End Sub
½Æ»s¥N½X
§Ú§â§Aªº updateFollow() »P§Aªº»Ý¨D¡A¥þ³¡¾ã¦X¦b¤@°_¡A
½Ð±N¥¦¥þ³¡Âл\©ó ThisWorkbook µ{¦¡½X½s¿è°Ï¶ô¤º¡C
¨C¤é 08:45:00 ¥H«e¶}±Ò¥¦ ¡A 08:45:00®É¶¡¤@¨ì¡A¨t²Î«K·|¦Û°Ê±Ò°Ê°õ¦æ¡A
13:45:00¤@¶W¹L®É¶¡¡Aµ{¦¡«K·|¦Û°Ê°±¤î¤£¦A°õ¦æ¡C
«ö¶s§A¥i¥H«O¯d¡A¦pªG¨t²Î©ó¬ðµoª¬ªp¤U°±¤î¹B§@¡A
§A¥i¥HÂI¿ï«ö¶s«ì´_¨t²Î¹B§@¡C

TOP

¦^´_ 26# c_c_lai

·PÁÂc_c_¤j¡A¦ý§Ú¤µ¤Ñ¹J¨ì¤@­Ó°ÝÃD¡A´N¬O¹q¸£¬ðµM·í¾÷µL¦^À³¡A±j¨îÃö¾÷«á¡A ³o­Óexcel¶}±Ò³£·|"¨S¦³¦^À³"¡A½L¤¤ªº¸ê®Æ¤]¨S¦³Àx¦s¤U¨Ó¡A³o¬O«ç»ò¦^¬O©O?

TOP

¦^´_ 27# n8975067
¦¬¦¬ E-Mail¡A¤U¸ü«á©ú¤Ñ
§A¦A¥Î§ÚªºÀɮ׸ոլݡI

TOP

¦^´_ 26# c_c_lai
  1. Option Explicit
  2. Sub updateFollow()
  3.     Dim Rng As Range
  4.     With Sheet2
  5.         'Set Rng = .Range("A" & .Range("A" & .Rows.Count).End(xlUp).Row + 1).Resize(1, 10)
  6.         Set Rng = .Range("A" & .Rows.Count).End(xlUp).Offset(1).Resize(1, 10) '³o¼Ë¥i²²¤¨Ç
  7.         Rng = Sheet1.[c2:L12].Value        'C:L ¦@10Äæ,¥B¬°³sÄò ¥i¥Î¦p¦¹»yªk
  8.         'Rng(1) = Sheet1.[c2]
  9.         'Rng(2) = Sheet1.[d2]
  10.         'Rng(3) = Sheet1.[e2]
  11.         'Rng(4) = Sheet1.[f2]
  12.         'Rng(5) = Sheet1.[g2]
  13.         'Rng(6) = Sheet1.[h2]
  14.         'Rng(7) = Sheet1.[i2]
  15.         'Rng(8) = Sheet1.[j2]
  16.         'Rng(9) = Sheet1.[k2]
  17.         'Rng(10) = Sheet1.[l2]
  18.     End With
  19.     '­â±á ¹sÂI¹s¤À       #12:00:00 AM#
  20.     '­â±á ¹sÂI¹s¤À30¬í   #12:00:30 AM#
  21.     '­â±á ¹sÂI1¤À        #12:01:00 AM#
  22.     '­â±á ¹sÂI5¤À        #12:05:00 AM#
  23.     Application.OnTime Now + #12:00:30 AM#, "ThisWorkbook.updateFollow"     '  ¨C30¬íÄÁ©I¥s ¤@¦¸
  24. '  Application.OnTime Now + #12:01:00 AM#, "ThisWorkbook.updateFollow"     '  ¨C¤@¤ÀÄÁ©I¥s ¤@¦¸
  25. '  Application.OnTime Now +  #12:05:00 AM#, "ThisWorkbook.updateFollow"    '  ¨C¤­¤ÀÄÁ©I¥s ¤@¦¸
  26. '  Application.OnTime Now + 60 / 86400#, "ThisWorkbook.updateFollow"       '  ¨C¤@¤ÀÄÁ©I¥s ¤@¦¸
  27. '  Application.OnTime Now + 300 / 86400#, "ThisWorkbook.updateFollow"      '  ¨C¤­¤ÀÄÁ©I¥s ¤@¦¸
  28. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  c_c_lai
GBKEE µoªí©ó 2013-4-29 16:01

¦n¤[¨SÁpµ¸¤F¡Aªñ¨Ó¶¶·N§a¡I
Application.OnTime Now + 300 / 86400#, "ThisWorkbook.updateFollow"
¬O¶¶À³¥L­ì¥»ªºµ{¦¡¦Ó¥¼¥[¥H²§°Ê¡A§Ú­Ó¤H²ßºD¥Î±z«ü±Ðªº»yªk¡B
©Î¬O§ì¨ú¬Y³]©wÄæ¦ì§@¬°°ÊºA³B²z¡AÁÂÁ±z¡I

TOP

        ÀR«ä¦Û¦b : ­n§åµû§O¤H®É¡A¥ý·Q·Q¦Û¤v¬O§_§¹¬üµL¯Ê¡C
ªð¦^¦Cªí ¤W¤@¥DÃD