Guest User

Untitled

a guest
Jun 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Sub Timer()
  2. Const COUNTDOWN As Integer = 5
  3.  
  4. Dim testButton As Excel.Button
  5. Set testButton = Application.ActiveSheet.Buttons("TestButton")
  6. testButton.Select
  7.  
  8. For i = COUNTDOWN To 0 Step -1
  9. ActiveCell.FormulaR1C1 = i
  10. testButton.Caption = i
  11. Call Application.Wait(Now + TimeValue("00:00:01"))
  12. Next i
  13. End Sub
Add Comment
Please, Sign In to add comment