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

°õ¦æ®É¶¡°ÝÃD?

¦^´_ 31# c_c_lai
³o¼Ë¤]·|¦Û°Ê¤Æ
DDE³sµ²¤u§@ªí¼Ò²Õµ{¦¡½X
  1. 'DDE³sµ² ¤u§@ªíªº¹w³]¨Æ¥ó :  ·í¤½¦¡¸ê®Æ¦³Åܰʮɷ|IJµo¦¹¨Æ¥ó
  2. Dim TheTime As Date  '°O¿ý¤U¤@¤ÀÄÁªº®É¶¡ : DDE³sµ²¤u§@ªí¼Ò²Õªº¨p¥ÎÅܼÆ
  3. Private Sub Worksheet_Calculate()
  4.      Application.EnableEvents = False
  5.     If IsError([C2]) Or Time < #8:45:00 AM# Then
  6.         Sheets("µ¦²¤°O¿ý").[a1].CurrentRegion.Offset(1).Clear
  7.         Application.EnableEvents = True
  8.         Exit Sub
  9.     ElseIf Time > #1:30:00 PM# Then
  10.        Application.EnableEvents = True
  11.         Exit Sub
  12.     End If   
  13.     If CDbl(TheTime) = 0 Or TheTime <= Time Then    ' TheTimeÅܼƥ¼µ¹­È  or   °O¿ý¤U¤@¤ÀÄÁªº®É¶¡>= Time
  14.         With Sheets("µ¦²¤°O¿ý")
  15.             .Cells(.Rows.Count, 1).End(xlUp).Offset(1).EntireRow = Rows(2).Value
  16.         End With
  17.         TheTime = TimeSerial(Hour(Time), Minute(Time), 0) + #12:01:00 AM#
  18.     End If
  19.     Application.EnableEvents = True
  20. End Sub
½Æ»s¥N½X

TOP

¦^´_ 35# c_c_lai
  1. '#   #  ¬°¨t²Î¿é¤J¤é´Á®É¶¡ªºÃöÁä¦r
  2. '#00:00#  ¨t²Î¦Û°Ê¥Í¦¨ -> #12:00:00 AM#
  3. '#11:59#  ¨t²Î¦Û°Ê¥Í¦¨ -> #11:59:00 AM#
  4. '#13:01#  ¨t²Î¦Û°Ê¥Í¦¨ -> #1:01:00 PM#
  5. '#23:01#  ¨t²Î¦Û°Ê¥Í¦¨ -> #11:01:00 PM#
  6. Option Explicit
  7. Sub Ex()
  8.     Dim TheTime As Date, xTime As Date
  9.     MsgBox "#11:59:59 AM# + #12:00:01 AM#" & Chr(10) & CDate(#11:59:59 AM# + #12:00:01 AM#)
  10.     TheTime = #8:45:05 AM#
  11.     xTime = TimeSerial(Hour(TheTime), 0, 0)
  12.     MsgBox xTime
  13.     xTime = TimeSerial(Hour(TheTime), Minute(TheTime), 0)
  14.     MsgBox xTime
  15.     xTime = TimeSerial(Hour(TheTime), Minute(TheTime), 0) + #12:01:00 AM#
  16.     MsgBox xTime
  17. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD