I have made a selection list with text-values. I want to choose more than one value from the selection list on the same cell and be comma seperated. Is there any way? Thanks
How did you make your “selection list”?
Did you use >Data>Validity> ? What else?
Generally prefer the semicolon as a list separator. It will help to avoid ambiguity othewise easily occurring as soon as some of the strings represent numbers.
As far as I know there is no ready-made toll for what you (supposedly) want.
“Any way” will exist next to always concerning the manipulation of contents in spreadsheets.
Alas! There often isn’t a ready-made tool.
If I understood (in principle) correctly what you want to achieve,my attached example may give you a clue how to do it with the help of user code (“macro”).
=== Edit 2020-06-30 about 09:40 UTC ===
Don’t use the above attached solution. It’s buggy, and I only didn’t delete it to not cover the tracks concerning the discussion below. After all an analysis of the bug is instructive in itself for those intending to actively use the
ASPI API themselves.
The fixed version of the demo now:
@Lupp, Find&Replace a few typo error in your file and delete this (my) comment: stings&strings; D9&; D20:E20&D21:E21; fous&focus.
Thank you very much for your help.
When trying to run macro at the step 7 it says “BASIC runtime error. Property or method not found: RangeAddress”
What can i do?
In fact the demo I had attached contained a “bug”: It assumed an actual multi-selection of source ranges without justification, and fails if only exactly one range is selected as source. The issue is fixed in the new demo I will attach now to my answer.
The bug you found should only occur if exactly one cell is selected as source.
In this case a “slightly” problematic way of the API to handle the access to its services spoils the situation: The cell is not clearly distinguished from the text it’s containing. Therefore the
For Each loop is supposed to be about portions of the text in this case (no RangeAddress then, of course) instead of about contents of a
This bug wasn’t consciously af´ddressed by my mentioned fix, but is fortunately also fixed by it.