I have a program that creates check boxes depending on previous selecting made in the sheet. When the program is re-run, at the start, I need all of the check boxes that popped up during the previous run to be deleted.
When the program runs, I first clean up all previously generated data
Worksheets(1).Select
Range(Cells(27, 1), Cells(37, 19)).Clear
Cells(22, 5).ClearContents
'Here, I need to clear the generated checkboxes
Here is how they were created in the code.
Dim rst As Integer
Dim stu As Integer
Dim bcd As Integer
Dim Num_Bnchmrks As Integer
Num_Bnchmrks = 4
stu = 0
For rst = 1 To m
Do While bcd < Num_Bnchmrks
With Worksheets(1)
Set cb = .Shapes.AddFormControl(xlCheckBox, 270, 313 + stu * 16, 100, 10)
cb.ControlFormat.LinkedCell = Cells(22, 22 + bcd)
End With
bcd = bcd + 1
stu = stu + 1
Loop
bcd = 0
Next rst