How to store a large set of pulldown values..


Posted by Vikram on January 03, 2001 12:21 PM

Hi,

I have a set of 5000 values(around 62000 characters). I need to show all these 5000
values as a pulldown menu in an excel sheet.

Currently I have used the following statement:

with selection.validation

.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
Operator:=xlBetween, Formula1:=sPullDownValues
end with

where the string variable: 'sPullDownValues' contains a comma delimited string
of all the possible values.

A runtime error appears when I try to save these (62k) characters in the
string variable and assign it to the formula.

Anyone can please suggest me with an idea or an alternative solution
as to how to overcome this problem.

Any immediate help will be greatly appreciated.

THanks in ADvance,
Vikram



Posted by Tim Francis-Wright on January 04, 2001 10:20 AM

I suspect (but haven't proven) that Excel is
choking on the length of the string.

Could you store the pulldown values in
a column in a worksheet? Then, you could
have Formula1 refer to that list. I did a
quick test and found that Excel was happy
with a 5000+ cell validation column.

One advantage to this method is that you can
modify the values quite easily. (Of course,
you can hide the relevant column and protect
the cells to keep the list safe from mischief.)

Good luck!