Consulting

Results 1 to 5 of 5

Thread: Timer/StopWatch - How do I make button turn to red and flash when I click Start?

  1. #1
    VBAX Newbie
    Joined
    Dec 2018
    Posts
    4
    Location

    Timer/StopWatch - How do I make button turn to red and flash when I click Start?

    The way my code works now is that the Start and Stop button is one in the same. The button is green. What I would like to happen is that when I click Start and the button changes to Stop I would also like for the color to change to red and to flash.

    Sub startStopTimer()
        If Range("timer.button.label") = "Start" Then
            Range("time.stamp.start").Offset(Range("count.of.timestamps") + 1).Value = Now
            Range("timer.button.label") = "Stop"
        Else
            Range("time.stamp.start").Offset(Range("count.of.timestamps"), 1).Value = Now - Range("time.stamp.start").Offset(Range("count.of.timestamps"))
            Range("timer.button.label") = "Start"
        End If
    End Sub
    Thank you in advance for any help,
    yeto

  2. #2
    VBAX Newbie
    Joined
    Dec 2018
    Posts
    4
    Location
    Quote Originally Posted by yeto View Post
    The way my code works now is that the Start and Stop button is one in the same. The button is green. What I would like to happen is that when I click Start and the button changes to Stop I would also like for the color to change to red and to flash.

    Sub startStopTimer()
        If Range("timer.button.label") = "Start" Then
            Range("time.stamp.start").Offset(Range("count.of.timestamps") + 1).Value = Now
            Range("timer.button.label") = "Stop"
        Else
            Range("time.stamp.start").Offset(Range("count.of.timestamps"), 1).Value = Now - Range("time.stamp.start").Offset(Range("count.of.timestamps"))
            Range("timer.button.label") = "Start"
        End If
    End Sub
    The below is a link to the timer which I use and the page includes a link to download the worksheet/spreadsheet if needed.

    https://chandoo.org/wp/building-a-si...ed-case-study/

    Thank you in advance for any help,
    yeto

  3. #3
    VBAX Newbie
    Joined
    Dec 2018
    Posts
    4
    Location
    I have posted this question in a different forum. Please still help if you can.

    https://www.ozgrid.com/forum/forum/h...-first-clicked

  4. #4
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi yeto!
    For a simple example, Please refer to the attachment.
    Attached Files Attached Files

  5. #5
    VBAX Newbie
    Joined
    Dec 2018
    Posts
    4
    Location
    Quote Originally Posted by 大灰狼1976 View Post
    Hi yeto!
    For a simple example, Please refer to the attachment.
    Thank you for taking time to help. This will be very helpful.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •