- ©«¤l
- 6
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 36
- ÂI¦W
- 0
- §@·~¨t²Î
- x64
- ³nÅ骩¥»
- win7
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2012-7-11
- ³Ì«áµn¿ý
- 2019-12-31
|
[µo°Ý] ¤£¤ÓÀ´¬°¤°»òmodule1¸òthisworkbookªºÃö«Y
±qºô¸ô¤W§ä¨ìªºDDE¬ö¿ýµ{¦¡¡A¾Ç²ß¤W¡A¤£À´¬°¤°»òmodule1¸òthisworkbook?³£n°µ¬Û¦PªºÅܼƫŧi¤]³£¦³ExeSelf()ªº¨ç¼Æ?
쥻¥H¬°¦bmodule1¤W«Å§iÀ³¸Ó´N³£¥i¥H¨Ï¥Î¤~¹ï¡C
¦ý¬O¹ê»Ú´ú¸Õ¤W§R±¼¨ä¤¤¤@ÓÅܼƫŧi©Î¬OExeSelf()¡Aµ{¦¡´N¶]¤£°Ê¤Fµo¥Í¥¨¶°¿ù»~¡C
·|·Qn§R±¼¨ä¤¤¤@Ó¬O¦]¬°¦³®ÉÔ¶]¤@¶]쥻¤@¤ÀÄÁ°O¾Ð¤@¦¸«oÅܦ¨30¬í°O¾Ð¤@¦¸¡C
½Ð«üÂI¤@¤U¡A«D±`·PÁ¡C
Module1
Dim i, j As Single
Dim Min_Bar(1000, 6) As Variant 'Time, O,H,L.C,V
Dim O As Single
Dim H As Single
Dim L As Single
Dim C As Single
Dim V As Single
Dim NP As Single
Sub Ãö³¬DDE¦Û°Ê¥æ©ö¨t²Î()
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:02"), "ThisWorkBook.ExeSelf", , False
End Sub
Sub ±Ò°ÊDDE¦Û°Ê¥æ©ö¨t²Î()
Dim k As Single
j = 2
Application.OnTime TimeValue("08:45:00"), "ExeSelf"
'Call ExeSelf
End Sub
Private Sub ExeSelf()
On Error Resume Next
i = i + 1
If i = 58 Then
Sheets(2).Cells(j, 1) = Time
Sheets(2).Cells(j, 2) = O
Sheets(2).Cells(j, 3) = H
Sheets(2).Cells(j, 4) = L
Sheets(2).Cells(j, 5) = C
Sheets(2).Cells(j, 6) = V
j = j + 1
i = 0: V = 0
O = Sheets(1).Cells(2, 2)
V = V + Sheets(1).Cells(2, 4)
H = O: L = O: C = O
Else
'¥H¤U§PÂ_°j°éÅý§ë¸êÅv«»P§ë¸ê¼Ðªºª«¦WºÙ³]©w¡A¶È°õ¦æ¤@¦¸
C = Sheets(1).Cells(2, 2)
If C > H Then H = C
If C < L Then L = C
V = V + Sheets(1).Cells(2, 4)
' Sheets(2).Cells(i, 1) = Sheets(1).Cells(2, 2)
End If
Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkBook.ExeSelf"
End Sub
ThisWorkbook
Dim i, j As Single
Dim Min_Bar(1000, 6) As Variant 'Time, O,H,L.C,V
Dim O As Single
Dim H As Single
Dim L As Single
Dim C As Single
Dim V As Single
Dim NP As Single
Private Sub Workbook_Open()
j = 2
'Call ExeSelf
End Sub
Private Sub ExeSelf()
On Error Resume Next
i = i + 1
If i = 60 Then
Sheets(2).Cells(j, 1) = Time
Sheets(2).Cells(j, 2) = O
Sheets(2).Cells(j, 3) = H
Sheets(2).Cells(j, 4) = L
Sheets(2).Cells(j, 5) = C
Sheets(2).Cells(j, 6) = V
j = j + 1
i = 0: V = 0
O = Sheets(1).Cells(2, 2)
V = V + Sheets(1).Cells(2, 4)
H = O: L = O: C = O
Else
'¥H¤U§PÂ_°j°éÅý§ë¸êÅv«»P§ë¸ê¼Ðªºª«¦WºÙ³]©w¡A¶È°õ¦æ¤@¦¸
C = Sheets(1).Cells(2, 2)
If C > H Then H = C
If C < L Then L = C
V = V + Sheets(1).Cells(2, 4)
' Sheets(2).Cells(i, 1) = Sheets(1).Cells(2, 2)
End If
Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkBook.ExeSelf"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
'Application.OnTime Now + TimeValue("00:00:10"), "ThisWorkBook.ExeSelf", , False
End Sub |
|