erasing checkboxes

M

marksuza

Hi, I dont have much background in programming so I need a little hel
with a piece of code a put together to erase checkboxes in a specifi
range.

Sub Erase3()

Dim myCBX As CheckBox

For Each myCBX In Range("A10:A15")
myCBX.Delete
Next
End Sub

It gives me type mismatch. What does it mean? And can anybody help me
Thank
 
T

Tom Ogilvy

Dim myCBX As CheckBox

For Each myCBX In ActiveSheet.Checkboxes
if not Intersect(myCBX.TopLeftCell, _
Range("A10:A15")) is nothing then
myCBX.Delete
End if
Next
End Sub

Assumes textboxes are from the forms toolbar.
 
Top