B,
I dont know the ins-and-outs of coding for data validation tools, Do you really need to use it for this application? The dropdown that comes from the data validation function is system generated and I've never tried to reference it through code...
However here's code that will generate an array based on a group of cells. You can do it in two ways, base the list on all cells in a named range, or start at one cell and move along until you find a blank cell (The code below does it this way, but I've set it up so you can insert your own code to do it the first way). The data validation function bases itself on a range of cells, so this should do the trick for you I think...
function PopArrayFromRange (rMyRange as Range) as Variant
dim iCount as integer
dim vReturnArray as variant
if rMyRange.cells.count>1 then
'\\cycle through cells in range
elseif rMyRange.cells.count = 1 then
'\\start from range cell and move according to bDown
redim vReturnArray(0)
vReturnArray(0) = rMyRange.Value
icount = 1
do
if rMyRange.offset(icount, 0).value <> "" then
redim Preserve vReturnArray(iCount)
vReturnArray(icount) = rMyRange.offset(iCount, 0).value
icount = icount + 1
else
PopArrayFromRange = vReturnArray
exit function
end if
loop until iCount> rMyRange.Parent.Usedrange.Rows.count
End if
PopArrayFromRange = vReturnArray
end function
I haven't tested this code BTW, so you might find a little syntax error here and there, nothing you wont be able to iron out I'm sure...(I've also taken a few short cuts as well, again, I'm sure you can expand on the functionality where required)
Hope it helps
Kaah.