ComboBox Lists

C

Corey

Hi all,

Need some help.

If a comboBox list is a set range from a worksheet, and as in my case it is a list of customer names.
When selected it creates a new worksheet and pastes the selection into a cell.

But if the customer is Not in the list, can i have the New customer added to the range somehow by code from the combobox value ?

Corey....
 
H

Harald Staff

Hi Corey

Sure. If the entry is not in the list then the combobox'es ListIndex is -1. So if it's -1 then add the value to the list.

HTH. Best wishes Harald

"Corey" <[email protected]> skrev i melding Hi all,

Need some help.

If a comboBox list is a set range from a worksheet, and as in my case it is a list of customer names.
When selected it creates a new worksheet and pastes the selection into a cell.

But if the customer is Not in the list, can i have the New customer added to the range somehow by code from the combobox value ?

Corey....
 
W

witek

Corey said:
/Hi all,/
//
/Need some help./
//
/If a comboBox list is a set range from a worksheet, and as in my case
it is a list of customer names./
/When selected it creates a new worksheet and pastes the selection into
a cell./
//
/But if the customer is Not in the list, can i have the New customer
added to the range somehow by code from the combobox value ?/
//
/Corey..../


adding at the end.
cbo.AddItem "value", cbo.ListCount

if you have multicolumn combo you can fill out other columns with

cbo.List(cbo.ListCount - 1, column) = "text"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top