editing combo box list

asma410

New Member
Joined
Feb 1, 2005
Messages
35
hi!
i have created a combo box in excel using control toolbox. also, i added a list to the box using VB code. i need a code which will enable me to edit the contents of the list. the code to create the list runs as follows:

Private Sub Worksheet_Activate()
ComboBox1.Clear
ComboBox1.AddItem "electrical"
ComboBox1.AddItem "mechanical"
ComboBox1.AddItem "chemical"
End Sub

this will give me a list to choose from for the dropdown combo box: electrical, mechanical, chemical . now, i need to compile a code which will allow the user to add or delete items from the list (ex: add "civil" or delete "chemical).
please send in suggestions. i will really appreciate it.

note: the task of add/delete items is to be done by directly typing in the combo box & not by going inside the code & making changes.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Is it possible to have the data on another sheet? or on the existing sheet in a hidden column? This would make your life alot easier.

Michael
 
Upvote 0
Hey Michael!
I had thought about it, but unfortunately I am not supposed to do that. :cry:

i am writing the code in VB to add few items in the list. it would be easy for the user to make changes from the list items & this is to be done by typing in the combobox located on excel sheet. he need not go 'inside the code' (or some other destination) everytime he has to make changes. is there anyway i can incorporate this event or feature in the code which will allow him to take this action without bothering to enter the code & make the detailed changes. :oops:

note: my concern is to make the combobox 'user friendly'; (y)
the combobox should allow the user to add items in the list by directly typing in the box or select an existing item & hit delete in order to permanently delete that item from the list.
 
Upvote 0

Forum statistics

Threads
1,207,011
Messages
6,076,143
Members
446,187
Latest member
LMill

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top