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

[µo°Ý] ½Ð±Ð¤@¤U¶]°j°é¦p¦ó¨Ï¥Î¨ä¥LXLS

[µo°Ý] ½Ð±Ð¤@¤U¶]°j°é¦p¦ó¨Ï¥Î¨ä¥LXLS

¦pÃD¡G§Ú¼g¤F¤@­Ó²³æªºVBA¦ý¬Oµo²{¥u­n¶}©l¶]°j°é®É¡A´N¤£¯à¶}¨ä¥LXLSÀÉ»P¦Û¤vÀɪº¨ä¥Lsheets
Private Sub CommandButton1_Click()
Do While Range("B2") = 1
Range("A1") = Range("A2")
DoEvents
Loop
End Sub

½Ð±Ð¦U¦ì¥ý¶i¦p¦ó¦b¶]°j°é®ÉÁÙ¥i¥H¥Î¨ä¥LªºEXCELÀÉ»P½s¿è¦Û¤v¨ä¥Lªº¬¡­¶
YOYO

ÁÂÁÂet5323 ¡A§Ú¦A¸Õ¸ÕonTimeªº¤èªk...¦hÁ¡I
YOYO

TOP

1.§Aªº¥N½XÀ³¸Ó®Ú¥»´N¤£¯à¹B¦æ¡A¦]¬°Settimerªº¦^½Õ¨ç¼Æ´N¤£¬O¶H§AªºAsub©MBsub¨º¼Ë¼gªº¡A¨ãÅ骺¬dMSDN¡C
2.¥Ñ©ó¥Î¤FAPI,«Ü®e©ö´N±Y¼ì©Î³´¤J³¬Àôªº¤U³õ¡C
3.³Ì¦nÁÙ¬O¦Ò¼{¥ÎVBAªºonTime¨Ó¼g¡C

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-10-3 14:36 ½s¿è

¦^´_ 10# yanto913
API ¨ç¼Æ§Ú¤£¼ô, ÁÙ¬O¦^¨ì§A¤@¼ÓªºDO  LOOP °j°é¸Õ¸Õ¬Ý,¦ýÁÙ¬O¦³¯ÊÂI ¦pÀx¦s®æ¦³¦b§@¿é¤J°Ê§@,µ{¦¡·|°±¤î
Moduleªºµ{¦¡½X
  1. Dim MyTime As Single, MyStop As Boolean
  2. Private Const PauseTime = (1 / 60) * 2  ' " * 2 " ->  "0.2¬í"
  3. Sub StartAsub()
  4.     MyStop = False
  5.     MyTime = Timer + PauseTime
  6.     Do
  7.         If MyTime <= Timer Then
  8.             MyTime = Timer + PauseTime
  9.             With Workbooks("Book1.xls").Sheets("Sheet1").Range("a1")
  10.                 .Value = .Value + 1
  11.             End With
  12.         End If
  13.         DoEvents
  14.     Loop While MyStop = False
  15. End Sub
  16. Sub StopAsub()
  17.     MyStop = True
  18. End Sub
½Æ»s¥N½X

TOP

ª©¤j­Ì¡A¥h±¼ ActiveSheet.¡A¥i¥H¶}¦ý¬O·|µo¥Í
1.·íSheet1¸õ¨ìSheet2¨S°ÝÃD¡ASheet2¦A¸õ¨ìSheet3´N·|¿ù»~¤F
2.·í­n½s¿èÀx¦s®æ®É¤]·|µo¥Í¿ù»~(A1¤´¦b­p¼Æ¤¤)
YOYO

TOP

¦^´_ 8# yanto913
With ActiveSheet.Workbooks("book1.xls").Sheets("sheet1").Range("b1")
»yªk¿ù»~  ½Ð¥h±¼ ActiveSheet.

TOP

§Ú±Nµ{¦¡­×§ï¦¨¦p¤U¡Aµ²ªGµ{¦¡Åܦ¨¤£¯à¶]¤F¡A¦Ó¥B¦b¥¼­×§ï«e¥i¥H¶]¨â­Óµ{¦¡¡A¦ý¶}±Ò¨ä¥LEXCELÀÉ«áµ{¦¡·|Åܦ¨¶]¨ì¥t¤@­Ó·sEXCEL°µ¹Bºâ(ex,¶]¨ìbook2.xls¤¤°µ­p¼Æ)
Option Explicit
Declare Function SetTimer _
    Lib "user32" ( _
        ByVal hWnd As Long, _
        ByVal nIDEvent As Long, _
        ByVal uElapse As Long, _
        ByVal lpTimerFunc As Long) _
As Long
Declare Function KillTimer _
    Lib "user32" ( _
        ByVal hWnd As Long, _
        ByVal nIDEvent As Long) _
As Long
'EXCELµøµ¡ªºhandle, id³]¬°1, ¨C 0.2¬í°õ¦æ1¦¸Asubµ{§Ç
Sub StartAsub()
    SetTimer Application.hWnd, 1, 200, AddressOf Asub
End Sub
Sub StopAsub()
    KillTimer Application.hWnd, 1
End Sub
Sub StartBsub()
    SetTimer Application.hWnd, 2, 500, AddressOf Bsub
End Sub
Sub StopBsub()
    KillTimer Application.hWnd, 2
End Sub
Sub Asub()
With ActiveSheet.Workbooks("book1.xls").Sheets("sheet1").Range("a1")
    .Value = .Value + 1
End With
End Sub
Sub Bsub()
With ActiveSheet.Workbooks("book1.xls").Sheets("sheet1").Range("b1")
    .Value = .Value + 1
End With
End Sub
YOYO

TOP

§Ú¸Õ¹L¥i¥Hªº¡C
¶}¥»¬¡­¶Ã¯ªº a.gif ¨ä¥L¤u§@ªí©Î¥t¶}·sÀɳ£¨S°ÝÃD¡C

TOP

GBKEEª©¤j
§Ú¸Õ¹L¤F¡A¥i¬O¤´µM¤£¯à¶}±Ò¨ä¥LEXCELÀÉ­C¡I
YOYO

TOP

¦^´_ 1# yanto913
«ü©ú¬O­þ¤@­ÓWorkBooks("xxx.xls").Sheets("xxx") ¸Õ¸Õ¬Ý
Private Sub CommandButton1_Click()
Do While WorkBooks("xxx.xls").Sheets("xxx").Range("B2") = 1
WorkBooks("xxx.xls").Sheets("xxx").Range("A1") = WorkBooks("xxx.xls").Sheets("xxx").Range("A2")
DoEvents
Loop
End Sub

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD