Macro to remove a flag from a specific cell

I extract the checkboxes into a spreadsheet, which will be used to select specific items to get the final value. There are a few unnecessary flags that stretch out, although probably 5 or so. I can use macros to get these unnecessary flags to specific cells. These unnecessary flags will not always be in the same place due to a change in my data, so I will have to delete them one at a time, which should not be a problem, except that I do not know the code to remove the flag from the active cell. I need code to remove a checkmark from an active cell or selected cell. I have included some of my codes that I tried below. The first section simply returns me to the correct cell to remove the checkmark. The second part is two different codes that I tried to delete, but did not work. I appreciate your input.

'To delete unwanted checkboxes Sheets("Quote Sheet").Select Range("B9").Select Selection.End(xlDown).Select ActiveCell.Offset(0, -1).Select ActiveSheet.Shapes.Range(Array("Check Box 456")).Select Selection.Delete Selection.Cut ActiveCell.CheckBoxes.Delete Selection.FormatConditions.Delete 
+4
source share
1 answer

This code will remove the Excel checkbox located in the active cell.

 Sub DeleteCheckbox() Dim cb As CheckBox For Each cb In ActiveSheet.CheckBoxes If cb.TopLeftCell.Address = ActiveCell.Address Then cb.Delete Next End Sub 

If you use ActiveX checkboxes, this code will complete the task:

 Sub DeleteActiveXCheckbox() Dim obj As OLEObject Dim cb As MSForms.CheckBox For Each obj In ActiveSheet.OLEObjects If TypeOf obj.Object Is MSForms.CheckBox Then Set cb = obj.Object If cb.ShapeRange.Item(1).TopLeftCell.Address = _ ActiveCell.Address Then obj.Delete End If Next End Sub 
+9
source

All Articles