ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   erasing checkboxes (https://www.excelbanter.com/excel-programming/285752-erasing-checkboxes.html)

marksuza[_5_]

erasing checkboxes
 
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

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

erasing checkboxes
 
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.

--
Regards,
Tom Ogilvy


"marksuza" wrote in message
...
Hi, I dont have much background in programming so I need a little help
with a piece of code a put together to erase checkboxes in a specific
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?
Thanks


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com