worksheet.combobox.clear method not workable ?

M

Marek

people,
i cant understand why in help is writed that combobox support clea
method,

but when i in macro write this

worksheets(1).drawingobjects("combo1").clear

then i get error like "this ibject dont supp this prop or method"


how it can be, that combobox method clear which is described in hel
dont want to work ????




thank
 
T

Tom Ogilvy

Control toolbox toolbar Comboboxes have a clear method. DropDowns from the
forms toolbar do not. They have removeallitems. This assumes that the box
was populated with AddItem (rather than linked to a range - data bound)

Sub SetBox()
For i = 1 To 10
Worksheets(1).DropDowns("combo1").AddItem "item" & i
Next
End Sub

Sub ClearBox()
Worksheets(1).DropDowns("combo1").RemoveAllItems
End Sub
 
Top