Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I add a value containing a comma to a dropdown's csv list

Status
Not open for further replies.

rastr

Programmer
Jun 10, 2009
2
In a previous thread, to make a dropdown list in Excel, someone said to use:

Public Sub CreateList()
With ActiveCell
.Validation.Delete
.Validation.Add xlValidateList, , , "Value1,Value2,Value3,Value4"
End With
End Sub

I want one of my values to contain a comma.
Is there a way to escape it?
 
Use a Range instead of an hardcoded list.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
If there's no escape character, I'll use another character instead of comma, probably semicolon. But it's a shame to give the user a different string just because the Office designers didn't think through this very basic design.

Similarly, I could use chr(130), but then it's misleading, e.g. if the user copies/pastes to another app, besides not being portable (not Isolatin1 besides being non-ASCII), they'll think they're getting a comma but this weird character may not be recognized as a comma by the receiving app.

Thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top