Is it possible to use a vba array as a list in Data Validation?
And then also do a vlookup on the array?
Thanks!
Is it possible to use a vba array as a list in Data Validation?
And then also do a vlookup on the array?
Thanks!
Not so far in my explorations..Originally Posted by sconly
I suppose you could arrange for the vba to write the array to a sheet, to have a dynamic name refer to that range and use that name in the Data Validation source field. In fact, if the list remains the same size, you could put an array-entered formula there eg. {=myaray} which will update itself each time the Name is updated.
..but I feel someone will be cleverer than that.
Yes, via a name, but the name has to be updated each time the array xxx changes:Originally Posted by sconly
[vba]Dim xxx(4, 5)
For i = 0 To UBound(xxx, 1)
For j = 0 To UBound(xxx, 2)
xxx(i, j) = i * j + i + j * 33 'this can be anything
Next j
Next i
ThisWorkbook.Names.Add "myary", xxx[/vba]
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.