Removing Checkboxes Programmatically

  • Thread starter Thread starter Mark D'Agosta
  • Start date Start date
M

Mark D'Agosta

Does anyone know how to remove checkboxes programmatically? These
checkboxes were added programmatically using the
"ActiveSheet.Checkboxes.Add..." syntax. Unfortunately
"ActiveSheet.Checkboxes.Remove..." generates a snytax error.

Someone in this newsgroup advised me of the Checkboxes.Add method, but I'm
unable to find any information on methods of adding or removing userform
controls in on-line help or from any other source. Are there some decent
sources of information that anyone knows of?

Thanks,
Mark D.
 
Hi Mark:

ActiveSheet.CheckBoxes.Delete

will remove all checkboxes on the sheet.

Regards,

Vasant.
 
Activesheet.Checkboxes.Delete

removes them all

Dim i as Long
Dim cbox as checkbox
i = 0
for each cbox in Activesheet.Checkboxes
i = i + 1
if i mod 2 = 0 then
cbox.delete
end if
Next

will delete every other one (as an example).
 
Thanks for the info on the Checkboxes.Delete method. It works just fine.
As to the second part of my question, where is this stuff documented? The
"Checkboxes" collection does not appear in the member autolist for the
worksheet object; it does not appear in the object browser under the
worksheet object; it's not in the VBA on-line help. Any ideas?

Thanks,
Mark D.
 
The controls are from xl5/xl95 and are maintained for consistency. Get a
copy of xl5 or xl95 and look at the help file and object browser for
documentation. You can go to the object browser and right click in a blank
area and select show hidden members and you will see the properties and
methods for the checkbox object and checkboxes collection.

I can send you a large word document that contains some good documentation
on them in the context of dialog sheets, but it pretty much equally
applicable to their use on worksheets. Contact me if you want me to send it
to you. The email I am using is a good email. Provide me with a good email
to sent it to.
 
Back
Top