I have a macro that creates command buttons on my sheet, and assigns the pertinent Macros to those command buttons. I can adjust the text to the color/style I want, but I can't figure out how to change the background colors. Can someone help? My code is shown below (BTW, after either selection I'll want to remove the buttons ("KillButts")-if someone can clue me on how to do that I'd appreciate that as well).:
Sub AddButtons()
Dim strBname As String
ActiveSheet.Buttons.Add(199.5, 10, 81, 65).Select
strBname = Selection.Name
Selection.OnAction = "ResumeAuto" 'Macro to run
Selection.Characters.Text = "Click here to Resume the Automation" 'Text of button
With Selection.Characters.Font
.Name = "Verdana"
.FontStyle = "Regular"
.Size = 9
.Color = vbBlue
End With
ActiveSheet.Buttons.Add(299.5, 10, 81, 65).Select
strBname = Selection.Name
Selection.OnAction = "KillButts" 'Macro to run
Selection.Characters.Text = "Click here to Cancel the Automation" 'Text of button
With Selection.Characters.Font
.Name = "Verdana"
.FontStyle = "Regular"
.Size = 9
.Color = vbRed
End With
Range("A1").Select
End Sub
Sub ResumeAuto()
MsgBox "Now we're resuming our process"
End Sub
Sub Killbutts()
MsgBox "Now we're killing the buttons"
End Sub
Bookmarks