How do I add an item with comma in the list of data validation

  • Thread starter Thread starter bhavna
  • Start date Start date
First of all, you should give more details for us to answer.
Based on the little explanation you have provided, I think you can list all
your items in excel and add comma at the end of each item. Then use this
range as input range for your Data Validation.

Thanks.
HTH,
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think a post is useful, please rate it as an ANSWER, it will help
others!!
 
Sorry about not being clear.
What I mean that I want to have data validation for a column with a list.
And as you know that list items needs to seperated with comma. My question is
that how can use a list item with comma. e.g. #,0, #.0 etc. In my case I want
my list to look like
#,0
#.0

Thanks
 
Enter your list in a range of cells.

When selecting source for list use that range rather than a comma-delimited
list.


Gord Dibben MS Excel MVP
 
Hi Gord

I tried to use the range but doesn't work in my case.
I am getting the list of values from the database and I am storing that in a
comma delimited string. I tried if can copy that string into range but it
doesn't work. If you or anyone has suggestions then please help me.

Thanks
 
Why are you storing the list of values in a comma de-limited string?

Why use a string? Just use the range of values as your source.

Select a cell then Data>Validation>List

In the "source" dialog enter =$F$1:$F$12 assuming that is your range of
values that you imported from the database.

Or create a defined name for the list.

Select the range of cells then

Insert>Name>Define name it MyList

In source enter =MyList

If you are using another sheet or workbook, the defined name method is the
only one you can use.


Gord Dibben MS Excel MVP
 
Let me be more clear.
In my excel file I read data from SQL server. Therefore when I get data from
server I save it in a comma delimited string as I apply this for data
validation list. All this happens in background with VBA. I don't want user
to see the data. User just see the list of choices for the given column.

If you or anyone have other suggestion will be helpful
Thanks
 
Select the cell with the comma delimited list.

F2 and CTRL + c to copy from the formula bar.

Select another cell to get out of edit mode then re-select the original.

Data>Validation>Allow>List>Source....Ctrl + v to paste.

Incorporate the steps in your VBA


Gord
 
Back
Top