Command Button Blink Color

pauloalf

New Member
Joined
Mar 26, 2011
Messages
2
Hello i use excel 2003 with the follow code :

Private Sub CommandButton1_Click()
If (CommandButton1.BackColor = &H8000&) Then
CommandButton1.BackColor = &HFF&
Sheet2.Cells(2, 3) = "Red"
ElseIf (CommandButton1.BackColor = &HFF&) Then
CommandButton1.BackColor = &HFFFF&
Sheet2.Cells(2, 3) = "Yellow"
ElseIf (CommandButton1.BackColor = &HFFFF&) Then
CommandButton1.BackColor = &H404080
Sheet2.Cells(2, 3) = "Brown"
ElseIf (CommandButton1.BackColor = &H404080) Then
CommandButton1.BackColor = &H808080
Sheet2.Cells(2, 3) = "Gray"
ElseIf (CommandButton1.BackColor = &H808080) Then
CommandButton1.BackColor = &HFF0000
Sheet2.Cells(2, 3) = "Blue"
ElseIf (CommandButton1.BackColor = &HFF0000) Then
CommandButton1.BackColor = &H80FF&
Sheet2.Cells(2, 3) = "Orange"
ElseIf (CommandButton1.BackColor = &H80FF&) Then
CommandButton1.BackColor = &H8000&
Sheet2.Cells(2, 3) = "Green"

End If
End Sub


What i want is blink the commando button just on th "Red" the other i dont want that blinks.
Thanks
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Your code is not making the command button blink so much as just changing color depending on another cell's value.

Explain more about what you are after, and especially reconstruct this line which does not make sense:
"What i want is blink the commando button just on th "Red" the other i dont want that blinks."
 
Upvote 0
ok my code just change colors but what i want is:

if i click in commandbutton1 then change the colors but if the commandbutton1 change to the color "red" then blink.

Is that what i want just blink on "red" not on the other color

Thanks a lot.
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,240
Members
452,898
Latest member
Capolavoro009

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