suznal


Is there a way to change the color of the tick mark in a checkbox without changing the default color of the box itself in VBA I want the default black checkbox, but when selected I want a red checkmark in the black box.

I found that I could change the color of everything (box and checkmark) in the properties window of the checkbox, but it's not what I'm after. I also could not not find a property in the VBE.

Can anyone help





Re: Excel - CheckBox Tick Color

Andy Pope


Hi,

I don't believe this is a property of the control you can alter,

Are you using controls on a worksheet or user form






Re: Excel - CheckBox Tick Color

suznal

The checkboxes are on a worksheet.







Re: Excel - CheckBox Tick Color

Andy Pope

You could, if you really wanted too, make your own checkbox from 2 rectangles.

First rectangle will act as the tick and tickbox, which you link to a cell. Second as the caption holder.
The cell would contain a formula for displaying a tickmark based on another cells content. The other cell is updated when the macro is run. And the macro is run by assigning it to the grouped rectangles.

So, create a rectangle. Link the rectangle to a cell, eg. G20. To link the shape just enter an = in the formula bar and select the cell. Format the font of the rectangel to Marlett and colour Red, set alignment to center both vertical and horizontal.

Create another rectangle and enter the text to be used as the checkbox caption. Position the 2 rectangles to appear like a checkbox, setting the Zorder of the caption to the back. Group the 2 shapes.

In cell G20 enter the formula

=IF(H20,"a","")

Create a macro to handle the grouped shape being clicked. And then assign it to the shape.

Sub MyCheckBox()

Range("H20") = Not Range("H20")

End Sub







Re: Excel - CheckBox Tick Color

suznal

Thanks, but I really don't want to do all of that.

With an average of fifteen per sheet, and one sheet that has five hundred checkboxes I think I'll be able to manage until MS adds the property.

But thanks Andy, It does in fact work! If I only needed to do a few then I might be interested in tackling it.