特定のセルのチェックボックスを削除するコードがありますが、選択した範囲のすべてのチェックボックスを削除する必要があります。以下は、特定のセルのチェックボックスを削除するコードです。
Columns("B:B").Select
Selection.Find(What:="FIELD SERVICES", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(1, -1).Select
Dim CB8 As CheckBox
For Each CB8 In ActiveSheet.CheckBoxes
If CB8.TopLeftCell.Address = ActiveCell.Address Then CB8.Delete
Next
以下は、必要な範囲のセルを削除するように変更しようとした方法ですが、範囲の最初のセルのチェックボックスのみを削除します。
Columns("B:B").Select
Selection.Find(What:="FIELD SERVICES", After:=ActiveCell, LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Range(ActiveCell.Offset(1, -1), ActiveCell.Offset(8, 0).Select
Dim CB8 As CheckBox
For Each CB8 In ActiveSheet.CheckBoxes
If CB8.TopLeftCell.Address = ActiveCell.Address Then CB8.Delete
Next
どんなアドバイスでも大歓迎です。