Hi all!
I have a list of text values that contain commas (city, state). They are contained in an array named UniqueValues(). I need to set the data validation for a cell to refer to this array. Because my data contains commas, I can't just build a comma-seperated string like I normally would. I tried the following code, but it didn't work:
MyCell.Validation.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=UniqueValues()
I could write the values to a range of cells and refer to the range, but I don't want to do that.
Any suggestions?
Thanks!
VBAjedi![[swords] [swords] [swords]](/data/assets/smilies/swords.gif)
I have a list of text values that contain commas (city, state). They are contained in an array named UniqueValues(). I need to set the data validation for a cell to refer to this array. Because my data contains commas, I can't just build a comma-seperated string like I normally would. I tried the following code, but it didn't work:
MyCell.Validation.Add Type:=xlValidateList, _
AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:=UniqueValues()
I could write the values to a range of cells and refer to the range, but I don't want to do that.
Any suggestions?
Thanks!
VBAjedi
![[swords] [swords] [swords]](/data/assets/smilies/swords.gif)