Checkbox and Formatting

chaosisbliss

New Member
Joined
May 14, 2011
Messages
7
I have the following checkbox Macro which works great. I have checkboxes from E3 to E45. What I would like to accomplish is when any checkbox value is True that it changes the color of the Row it's checked. For example, if E3 was checked, it would change A3:D3 to orange.

Thanks in advance.


Sub AddCheckBox()
Dim cell As Range

'DelCheckBox 'Do the delete macro
'or delete all checkboxes in the worksheet
' ActiveSheet.CheckBoxes.Delete

For Each cell In Range("E3:E45")
With ActiveSheet.CheckBoxes.Add(cell.Left, _
cell.Top, cell.Width, cell.Height)
.LinkedCell = cell.Offset(, 0).Address(External:=True)
.Interior.ColorIndex = 12 'or xlNone or xlAutomatic
.Caption = ""
.Border.Weight = xlThin
End With
Next

With Range("E3:E45")
.Rows.RowHeight = 15
End With
End Sub


Sub DelCheckBox()
For Each cell In Range("E3:E45")
Worksheets("Count").CheckBoxes.Delete
Next
End Sub
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,224,598
Messages
6,179,814
Members
452,945
Latest member
Bib195

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