I need to uncheck the checkboxes of only the selected cells
Hello this code works perfect to uncheck the checkboxes of all the sheet. I need it to uncheck only the checkboxes of a specified selection. Could you help me? I have tried a lot of things and nothing works
`Sub Unchecker()
Dim chkBox As Excel.CheckBox
Application.ScreenUpdating = False
For Each chkBox In ActiveSheet.CheckBoxes
chkBox.Value = xlOff
Next chkBox
Application.ScreenUpdating = True
End Sub`
Thank you
>Solution :
Pleas try it.
Sub Unchecker()
Dim chkBox As Excel.CheckBox
Application.ScreenUpdating = False
For Each chkBox In ActiveSheet.CheckBoxes
' Top-left of CheckBox is in Selection
If Not Intersect(chkBox.TopLeftCell, Selection) Is Nothing Then _
chkBox.Value = xlOff
Next chkBox
Application.ScreenUpdating = True
End Sub