A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear @Lalith,
Thank you so much for contacting Microsoft Q&A Forum.
Based on your description, you're correct that using the DocumentFormat.OpenXml library, you can create single-select dropdowns in Excel via data validation lists. However, multi-select dropdowns are not natively supported in Excel through data validation or OpenXML. So, here are more information for you:
What’s possible with OpenXML:
- Single-select dropdowns using DataValidationValues.List (as you’ve already implemented).
- These dropdowns allow the user to pick one value only from a predefined list.
What’s not possible natively:
- Multi-select dropdowns (i.e., selecting multiple values from a dropdown and having them appear in a single cell) are not supported by Excel’s built-in data validation.
- OpenXML cannot implement VBA macros or event-driven logic directly.
Reference: Create a drop-down list - Microsoft Support
Therefore, if you must have multi-select behavior, I have several ideas that you can check if they work:
- Add a note in the Excel file explaining that users can manually select multiple values by typing them in, separated by commas.
- Or embed a VBA macro using another tool to simulate multi-select behavior. This macro would:
- Trigger on cell selection or change.
- Append selected values to the cell, separated by commas.
- Trigger on cell selection or change.
I hope this information can help you to find a suitable way to finish it and please correct me if I misunderstand your concern.
Wish you a pleasant day!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.