ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to clear the contents of COmboBox? (https://www.excelbanter.com/excel-programming/295512-how-clear-contents-combobox.html)

Shilps

How to clear the contents of COmboBox?
 
Hi
I have combobox to which I add options on first itireation by Additem property. On next iteration, the old values shoudl be cleared but I cannot use Clear method, its giving error.
I later found that Clear method fails for comboboxes created at design time. Now on second iteration , although new values are added but values form previous additon remain( which are totally irrelevant in new context)
How do I clear the previous options of dropdownlist associated with the combobox
TI
Shilps

BrianB

How to clear the contents of COmboBox?
 
something like :-
MyForm.ComboBox1.Clea

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


Shilps

How to clear the contents of COmboBox?
 
Thanks Brian, but I have already stated that I am not able to stand Clear method as it is giving error. And the Combobox is on the worksheet , not on a form

BrianB

How to clear the contents of COmboBox?
 
I think you may need to copy/paste your setup code so we can see whic
control you are using.

Perhaps this is what you want, although it is a DropDown :-

Set MyDropDown = ActiveSheet.Shapes("Drop Down1")
MyDropDown.ControlFormat.RemoveAllItem

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


Shilps

How to clear the contents of COmboBox?
 
Brian I am adding the ComboBox from the control ToolBox and I think we cannot use the Shapes/Control Format property for that.


All times are GMT +1. The time now is 02:36 PM.

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