Toggle Button color change help

mwhyman2

New Member
Joined
May 16, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello. I am a teacher and trying to figure out the remote learning world. I need to create a reading document where kids can click a word and then the word is selected for me to see after they are done.
Example: I (is, went, am) to the store.
I want them to be able to click went and have the text change.

From all my searched it seems like maybe a toggle button would work?? But how do I change the color of the button once it is clicked on?

Any and all help trying to create this would be greatly appreciated.

I have the developer tab and have been trying to use the Active X options, just not sure what all I am doing.

Thanks
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
This might get tedious if you have a large number of questions .

VBA Code:
Option Explicit
Const defaultColor As Long = &H8000000F

Private Sub CommandButton1_Click()
    ActiveSheet.CommandButton1.BackColor = RGB(0, 255, 0)
    ActiveSheet.CommandButton2.Enabled = False
    ActiveSheet.CommandButton3.Enabled = False
End Sub

Private Sub CommandButton2_Click()
    ActiveSheet.CommandButton2.BackColor = RGB(0, 255, 0)
    ActiveSheet.CommandButton1.Enabled = False
    ActiveSheet.CommandButton3.Enabled = False
End Sub

Private Sub CommandButton3_Click()
    ActiveSheet.CommandButton3.BackColor = RGB(0, 255, 0)
    ActiveSheet.CommandButton1.Enabled = False
    ActiveSheet.CommandButton2.Enabled = False
End Sub

Private Sub CommandButton4_Click()
    ActiveSheet.CommandButton1.Enabled = True
    ActiveSheet.CommandButton2.Enabled = True
    ActiveSheet.CommandButton3.Enabled = True
    ActiveSheet.CommandButton1.BackColor = defaultColor
    ActiveSheet.CommandButton2.BackColor = defaultColor
    ActiveSheet.CommandButton3.BackColor = defaultColor
End Sub


Download file : Toggle Button Color.xlsm
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,283
Members
449,075
Latest member
staticfluids

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