Number format for Combobox

M

MBlake

Hi,
I have a user form that reads a list of numbers and places them into a
combobox. Often I have to add a new number to the list and here is the
problem. If I type a new number into the list and run the form, the new
number is not displayed in the combobox.

I have found that if I drag the old number list down and increase the number
to the new one I require and then delete any intervening numbers that are
not required, the combo box will then read the new additional number.

I have tried formatting all numbers to the same format but it makes no
difference. It is no hardship for me to add new numbers by the drag method
but I don't know why this happens. Any ideas would be greatly appreciated.

Cheers,
Mickey
 
D

Dave Peterson

How did you assign the list of valid values to that combobox.

If you gave the .rowsource property the range (say sheet1!a1:a10), then it won't
know if you add/delete from that range.

One way around it is to give your range a dynamic name. That name could refer
to a range that grows and contracts when you add/delete rows.

Take a look at Debra Dalgleish's site to read more about it:
http://www.contextures.com/xlNames01.html#Dynamic

You could do something in code, too that looks for the starting and ending
cells.
 
Top