checkbox macro

D

Dajana

I have created a macro:
Private Sub CheckBox131_Click()
Range("C26:G26").Select
Selection.Font.ColorIndex = 5
whenever I click the checkbox the text changes the color. However if I
uncheck the checkbox I would like the colour to go back to automatic black.
And then if I check it again I would like text to change color.

thanks
Dajana
 
S

Search33

Hi Dajana,
Try this
Sub CheckBox1_Click()
ActiveSheet.Shapes("check box 131").Select
If Selection.Value = xlOn Then
Range("C26:G26").Select
Selection.Font.ColorIndex = 5
Else
Range("C26:G26").Select
Selection.Font.ColorIndex = 1
End If

- Search
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top