assign this macro to the button
Option Explicit
Sub BtnSwitch()
'----------------------------------------------------------------------------------
' Author : Wotadude
' Date : 11-Jan-2013
' Purpose : switch button colour state
'----------------------------------------------------------------------------------
With ActiveSheet.Shapes(Application.Caller)
Select Case UCase(.TextFrame.Characters.Text)
Case "RED"
' if red now
.TextFrame.Characters.Text = "White"
.Fill.ForeColor.RGB = RGB(255, 255, 255) ' white fill
.TextFrame.Characters.Font.Color = RGB(255, 0, 0) ' red font
Case Else
' start with red
.TextFrame.Characters.Text = "Red"
.TextFrame.Characters.Font.Color = RGB(255, 255, 255) ' red fill
.Fill.ForeColor.RGB = RGB(255, 0, 0) ' white font
End Select
End With
End Sub
Bookmarks