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
if i click in commandbutton1 then change the colors but if the commandbutton1 change to the color "red" then blink.
what i want just blink on "red" not on the others colors.
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
if i click in commandbutton1 then change the colors but if the commandbutton1 change to the color "red" then blink.
what i want just blink on "red" not on the others colors.