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

TimeValue(Now) = TimeValue µLªkµo¨Æ¥ó??

TimeValue(Now) = TimeValue µLªkµo¨Æ¥ó??

¤u§@ªíªºcalculate¨Æ¥ó TEST.rar (4.5 KB)
Private Sub Worksheet_Calculate()
If TimeValue(Now) = TimeValue("18:25:00 ") Then
[A2] = 1
End If
End Sub

§Ú§â®É¶¡§ï¬°¥Ø«e®É¶¡(±±¨î¥xªº®É¶¡)¥[¤@¤ÀÄÁ, µ¥¤F¤@¤ÀÄÁ¤]¨S¤ÏÀ³?®É¶¡¨ì¤F¨S¿ìªkIJµo¨Æ¥ó???

Sub Start_Timer()
    Application.OnTime Now + TimeValue("00:01:00"), "Sonny"
End Sub

Sub Sonny()
    Range("A2").Value = 1
End Sub
ss

TOP

Sub Start_Timer()
    Application.OnTime Now + TimeValue("00:01:00"), "Sonny"
End Sub

Sub Sonny ...
sunnyso µoªí©ó 2013-6-28 23:01

©êºp
´ú¸Õ¹L¤F, ¤@¶}ÀÉÁÙ¬O¨S¿ìªkIJµo¡A­n°õ¦æStart_Timer(),¤~·|IJµo
IJµo±ø¥ó=>¥Ø«e®É¶¡¥[1¤ÀÄÁ µ¥©ó°õ¦æStart_Timer«á¥[1¤ÀÄÁ
1. ¦bCalculate ¸ÌµLªk±Ò°ÊStart_Timer ???
2. §Ú¬O­n¦b©T©wªº®É¶¡¥h°µ¬Y¨Æ,©Ò¥H"¥Ø«e®É¶¡¥[1¤ÀÄÁ" ¡A¤£¾A¦X§Ú¥Î

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-6-29 09:24 ½s¿è

¦^´_ 3# t8899
1#¼gªkªº·N«ä¬O·í¤u§@ªíªº¤½¦¡¦³­«·s­pºâ®É¡A¤~·|¥h°õ¦æWorksheet_Calculate¸Ì­±ªºµ{¦¡
¥L¤£¬O®É®É¨è¨è³£Àˬd¬O§_µ¥©ó TimeValue("18:25:00 ")¡AÀˬd®Éªº·í¤U®É¶¡¥i¯à¤w¸g¹L¤F¦n´X¬í¡A·íµM¤£·|¦¨¥ß¡C


3#
¤@¶}ÀÉÁÙ¬O¨S¿ìªkIJµo¡A­n°õ¦æStart_Timer(),¤~·|IJµo

³o­Ó§A¥i¥H¦b¤@¯ë¼Ò²Õ¤º©w¸q
  1. Sub auto_open()
  2.   Start_Timer
  3. End Sub
½Æ»s¥N½X
©ÎThisWorkbook¤º
  1. Private Sub Workbook_Open()
  2.   Start_Timer
  3. End Sub
½Æ»s¥N½X
³£¯àÅý¶}Àɮɦ۰ʰõ¦æStart_Timer


§Ú¬O­n¦b©T©wªº®É¶¡¥h°µ¬Y¨Æ,©Ò¥H"¥Ø«e®É¶¡¥[1¤ÀÄÁ" ¡A¤£¾A¦X§Ú¥Î

³o¤~¬O§A·Q¸Ñµªªº°ÝÃD
¦pªG¬O­n¶}±Ò¤u§@ªí«á¡A§Æ±æ¬Y­Ó®É¨è¨ì¹F®É´N¥h°µ¬Y¥ó¨Æ
¨ä¹êµª®×´N¦b«e­±¡A§A¥h¬d¬ÝApplication.OnTime»¡©úªº¸Ü..
  1. Application.OnTime ¤èªk
  2.     ¦w±Æ¤@­Óµ{§Ç¦b±N¨Óªº¯S©w®É¶¡°õ¦æ (¬J¥i¬°¬Y­Ó¤é´Áªº«ü©w®É¶¡¡A¤]¥i¬°«ü©wªº®É¶¡¤§«á)¡C
  3. »yªk
  4.     ¹Bºâ¦¡.OnTime(EarliestTime, Procedure, LatestTime, Schedule)
  5.     ¹Bºâ¦¡   ¥Nªí Application ª«¥óªºÅܼơC
  6. °Ñ¼Æ
  7.     ¦WºÙ ¥²­n/¿ï¥Î ¸ê®ÆÃþ«¬ ´y­z
  8.     EarliestTime     ¥²­n Variant ·Q­n°õ¦æµ{§Çªº®É¶¡¡C
  9.     Procedure        ¥²­n String ­n°õ¦æªºµ{§Ç¦WºÙ¡C
  10.     LatestTime       ¿ï¥Î Variant ¥i¥H¶}©l°õ¦æµ{§Çªº³Ì±ß®É¶¡¡C¨Ò¦p¡A°²³] LatestTime ³]¬° EarliestTime + 30¡A·í®É¶¡¨ì¤F EarliestTime ®É¡A¦pªG¥Ñ©ó¨ä¥Lµ{§Ç¥¿¦b°õ¦æ¤¤¦Ó¨Ï Microsoft Excel ¤£³B©ó [´Nºü]¡B[½Æ»s]¡B[°Å¤U] ©Î[´M§ä] ¼Ò¦¡¡A«h Microsoft Excel ·|µ¥«Ý 30 ¬í¥H§¹¦¨²Ä¤@­Óµ{§Ç¡C¦pªG 30 ¬í¤º Microsoft Excel µLªk¦^¨ì [´Nºü] ¼Ò¦¡¡A«h¤£·|°õ¦æ¦¹µ{§Ç¡C¦pªG¬Ù²¤¦¹¤Þ¼Æ¡AMicrosoft Excel ·|¤@ª½µ¥¨ì¥i¥H°õ¦æ¸Óµ{§Ç¬°¤î¡C
  11.     Schedule           ¿ï¥Î Variant ­Y¬° True¡A±Æµ{·sªº OnTime µ{§Ç¡C­Y¬° False¡A²M°£¥ý«e³]©wªºµ{§Ç¡C¹w³]­È¬° True¡C
½Æ»s¥N½X
´N¥i¥Hª¾¹D³o¼Ë¼g´N¦n¤F
  1. Sub auto_open()
  2.   Application.OnTime TimeValue("18:25:00"), "Sonny"  'Sonny©w¸q¦p2¼Ó
  3. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2013-6-29 10:29 ½s¿è
1#¼gªkªº·N«ä¬O·í¤u§@ªíªº¤½¦¡¦³­«·s­pºâ®É¡A¤~·|¥h°õ¦æWorksheet_Calculate¸Ì­±ªºµ{¦¡
¥L¤£ ...
stillfish00 µoªí©ó 2013-6-29 09:21


§ÚÀ´¤F
¦]¬°§Úªº¤u§@ªí¡A¦³§ìªÑ²¼¦æ±¡, Àx¦s®æ·|¤@ª½ÅÜ°Ê
§Ú¦b´ú¸Õ®É¡A¤w¸g¦¬½L¤F.............
©Ò¥H If TimeValue(Now) = TimeValue("18:25:00 ") Then
À³¸Ó¤]¬O¨S°ÝÃDªº!
§Ú¤U©P¤@¦b´ú¸Õ¬Ý¬Ý, ÁÂÁÂ
¥t¥~½Ð±Ð¤@¤U
If Format(Now, "hh:mm:ss") = "14:54:00" Then
[R31] = 1
¤Î SHEET1ªºR31=1  ===>¦¹¬qªº»yªk??
End If

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD