- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-8-26 11:49 ½s¿è
¦^´_ 14# c_c_lai
ThisWorkbook ¼Ò²Õªºµ{¦¡½X- Public ¬ö¿ý_Msg As Boolean
- Private Sub Workbook_BeforeClose(Cancel As Boolean)
- ¬ö¿ý_Msg = True
- End Sub
- Private Sub Workbook_Open()
- Run "¤u§@ªí1.¬ö¿ý" ' µ{¦¡¤@±Ò©l¡A«K¥h¦Û°Ê°õ¦æ ¤u§@ªí1.¬ö¿ý
- End Sub
- Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
- 'ThisWorkbook ªº«ºâ¨Æ¥ó
- 'Sh ¶Ç¦^¬Oþ¤@Ó¤u§@ªí¦³«ºâ
- End Sub
½Æ»s¥N½X ¤u§@ªí1¼Ò²Õªºµ{¦¡½X- '¤u§@ªí1¼Ò²Õªºµ{¦¡½X(«ºâ¨Æ¥ó )
- '¤u§@ªí1 ªºA1 B1 C2 D1 E1 : ®É¶¡/¶}½L/»ù³Ì°ª»ù/³Ì§C»ù/¦¬½L»ù
- Private Sub Worksheet_Calculate()
- Static Msg As Boolean '¥Î¥H§P©w¬O§_¬°¨C¤é²Ä¤@¦¸°õ¦æ
- Static Time_Calculate As Date '°O¿ý¨C¤ÀÄÁªº®É¶¡
- Static AR '°}¦C:°O¿ý¦¨¥æ»ù®æ
- If Time < #8:30:00 AM# Then Exit Sub
- Application.EnableEvents = False '°±¤îª«¥ó¯àIJµo¨Æ¥ó(Worksheet_Calculate)
- If Msg = False Then
- Time_Calculate = TimeSerial(Hour(Time), Minute(Time), 0) '¨C¤ÀÄÁªº®É¶¡
- Range("A1").CurrentRegion.Offset(1) = "" '²M²z¬Q¤é¸ê®Æ
- ReDim AR(0) '«·s³]¬°¤@¤¸¯À
- End If
- Msg = True
- If Time >= Time_Calculate + #12:01:00 AM# Then
- With Cells(Rows.Count, 1).End(xlUp).Offset(1)
- .Cells(1, 1) = Time_Calculate '®É¶¡
- .Cells(1, 2) = AR(0) '¶}½L»ù
- .Cells(1, 3) = Application.Max(AR) '³Ì°ª»ù
- .Cells(1, 4) = Application.Min(AR) '³Ì§C»ù
- .Cells(1, 5) = AR(UBound(AR)) '¦¬½L»ù
- End With
- Time_Calculate = TimeSerial(Hour(Time), Minute(Time), 0)
- ReDim AR(0)
- End If
- If AR(UBound(AR)) <> "" Then ReDim Preserve AR(UBound(AR) + 1) '«·s¦A¥[¤W¤@¤¸¯À
- AR(UBound(AR)) = [iv1] '°O¿ý¦¨¥æ»ù®æ¦¨¥æ»ù
- Application.EnableEvents = True '«ì´_ª«¥ó¯àIJµo¨Æ¥ó(Worksheet_Calculate)
- End Sub
- '¼Ó¥DÀɮ׬O¤Þ¥Î¤Ó¥¬vÃҨ骺DDE =¦n¯«³q!D4 ¤£¥²¦³¦¹µ{§Ç
- '¬ö¿ýµ{§Ç:¬O´ú¸ÕWorksheet_Calculateªº¥¿½T©Ê
- Private Sub ¬ö¿ý()
- '¬ö¿ý®É¶¡°õ¦æ°j°é ¤Å°õ¦æ¨ä¥Lµ{¦¡©Î¿é¤J¸ê®Æ
- Dim t As Date, »ù®æ(1 To 4) As Single
- »ù®æ(1) = 100
- »ù®æ(2) = Round(»ù®æ(1) + »ù®æ(1) * 0.07, 2)
- »ù®æ(3) = Round(»ù®æ(1) - »ù®æ(1) * 0.07, 2)
- t = Time
- Do
- DoEvents
- If Time > t + #12:00:05 AM# Then
- t = Time
- »ù®æ(4) = Round((»ù®æ(2) - »ù®æ(3) + 1) * Rnd() + »ù®æ(3), 2) '¦¨¥æ»ùªº¶Ã¼Æ
- If »ù®æ(4) > »ù®æ(2) Then »ù®æ(4) = »ù®æ(2)
- If »ù®æ(4) < »ù®æ(3) Then »ù®æ(4) = »ù®æ(3)
- [iv1] = "=" & »ù®æ(4) 'Àx¦s®æ¤½¦¡
- '**** nIJ°ÊWorksheet_Calculate: Àx¦s®æ¤½¦¡¤§È¦³ÅÜ°Ê ****
- Debug.Print [iv1]
- End If
- Loop While ThisWorkbook.¬ö¿ý_Msg = True Or Time <= #1:30:00 PM#
- 'Ãö³¬ÀÉÀÉ®× ©Î 1:30:00 PM °±¤î¬ö¿ý
- End Sub
½Æ»s¥N½X |
|