Flashing commandbutton...

1Big_Daddy

New Member
Joined
Jul 25, 2007
Messages
5
Is it possible to write code that would make a commandbutton flash to draw the user's attention?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try this. If you want delays of less than 1 second have a look at the API Sleep function.
Code:
Sub Flashy()
    With ActiveSheet.CommandButton1
        For n = 1 To 5
            .BackColor = &HC0C0FF               'pink
            DoEvents
            Application.Wait Now + TimeValue("00:00:01") ' 1 second
            .BackColor = &HC0C0C0               'grey
            DoEvents
            Application.Wait Now + TimeValue("00:00:01") ' 1 second
        Next
    End With
End Sub
 
Upvote 0
Resurrecting this post ...
This is a great start to what I'm looking for. Is anyone able to modify this to best go about having this commandbutton (on my userform) continue to blink until it's pressed?
 
Upvote 0
For my own personal use I don't think I need to worry about that, but thank you for your concern.
 
Upvote 0
Hi Joe4,
Just curious – this is a very old thread – as a MOD are you aware of any forum rule about thread “hijacking”? Not suggesting OP has done anything wrong just wondering how MrExcel views such activity?

Dave
 
Upvote 0
The forum rules can be found here: https://www.mrexcel.com/forum/board-announcements/99490-forum-rules.html
See rule #9 for the best way of handling these type of concerns.

I would not call this thread hijacking for two reasons:
- The thread has been dormant for 10 years
- The question was directly related to the replies

Thread hijacking is more commonly defined when someone posts their own question to an active thread, and the question quite often is very different from the question being asked.

That being said, I would recommend users post their questions to new threads instead of posting to old threads for the following reasons.
- Since the question already has replies, it will not show up on the "Zero Reply Posts" listing that many people go to in order to look for new unanswered questions, so it will get passed over by many potential helpers.
- Sometimes the users involved in the original thread are not that active on the forum anymore, so they might not see the question.

My recommendation would be to start a new thread, and include a link to this other thread, if it is helpful in explaining your issue. However, you typically only want to post the question once, as we do have rules against duplicate postings! So you need to pick one or the other.
 
Upvote 0
Hi,
I had a feeling that you would point out rule 9 but as said, did not think OP was doing anything wrong and also, going rule 9 route, others would not see the response which they may find useful.

I know another forums get quite animated with members stepping in to another’s thread but MrExcel (thankfully) less so but there does not seem to be much guidance in this area perhaps your very helpful response could be added to posting notes?

Many Thanks.

Dave
 
Upvote 0
Try this. If you want delays of less than 1 second have a look at the API Sleep function.
Code:
Sub Flashy()
    With ActiveSheet.CommandButton1
        For n = 1 To 5
            .BackColor = &HC0C0FF               'pink
            DoEvents
            Application.Wait Now + TimeValue("00:00:01") ' 1 second
            .BackColor = &HC0C0C0               'grey
            DoEvents
            Application.Wait Now + TimeValue("00:00:01") ' 1 second
        Next
    End With
End Sub

Please, how can I achieve this on a userform with command button I want to blink.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top