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

[µo°Ý] excel «ö¶s§@°Ê ÃC¦âÅÜ¤Æ ªº°ÝÃD

[µo°Ý] excel «ö¶s§@°Ê ÃC¦âÅÜ¤Æ ªº°ÝÃD

±Ò°Ê ºò«æ  °±¤î ¤T­Ó«ö¶s  ¦p¦ó³]©w ±Ò°Ê«ö¶s¦³«ö¬Oºñ¦â ¨S¦³«ö¬O¦Ç¦â
ºò«æ«ö¶s ©M°±¤î«ö¯Ã  ¦³«ö¬O¬õ¦â  ¨S¦³«ö¬O¦Ç¦â


Option Explicit
Dim TimerEnable As Boolean
Dim TimerStop As Boolean
Dim iValue As Integer


' ±Ò°Ê
Private Sub CommandButton5_Click()
    TimerEnable = True
    iValue = 0
    WaitFor 1 '¨C¬í­p¼Æ¤@¦¸
End Sub


' ºò«æ
Private Sub CommandButton1_Click()
TimerEnable = False
End Sub


' °±¤î
Private Sub CommandButton2_Click()
    TimerStop = True
End Sub

Public Sub WaitFor(Sec As Long)
Dim t0 As Long
Dim DnCnt As Boolean
   Do
         t0 = Timer
          While Timer - t0 < Sec
              DoEvents
          Wend
         
            If Not DnCnt Then
               iValue = iValue + 1
               If iValue >= 10 Then
                  DnCnt = True
               End If
                Sheets(1).Range("a1").Value = iValue
            Else
               iValue = iValue - 1
               If iValue <= 1 Then
                  
                  DnCnt = False
                    If TimerStop Then
                        TimerStop = False
                        TimerEnable = False
                        Exit Do
                     End If
               End If
               Sheets(1).Range("a1").Value = iValue
            End If
            If Not TimerEnable Then Exit Do
   Loop
    Sheets(1).Range("a1").Value = iValue
End Sub

¦^´_ 1# bqwangs
  1. Option Explicit
  2. Const ¦Ç¦â = &H8000000F
  3. Private Sub CommandButton1_Click()  ' ±Ò°Ê
  4.       CommandButton1.BackColor = vbGreen
  5.        CommandButton2.BackColor = ¦Ç¦â
  6.        CommandButton3.BackColor = ¦Ç¦â
  7.         
  8. End Sub
  9. Private Sub CommandButton2_Click()  ' ºò«æ
  10.         CommandButton2.BackColor = vbRed
  11.         CommandButton1.BackColor = ¦Ç¦â
  12.         CommandButton3.BackColor = ¦Ç¦â
  13. End Sub
  14. Private Sub CommandButton3_Click()   ' °±¤î
  15.         CommandButton3.BackColor = vbRed
  16.         CommandButton2.BackColor = ¦Ç¦â
  17.         CommandButton1.BackColor = ¦Ç¦â
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE
ÁÂÁª©¥D

TOP

        ÀR«ä¦Û¦b : ¡i¬°µ½Ävª§¡j¤H¥Í­n¬°µ½Ävª§¡A¤À¬í¥²ª§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD