Nirbhay Sharma
New Member
Hi all
I have implemented a multiselect dropdown list. This list basically allows a user to select multiple values in a cell seperated by a semi-colon. The multi-select dropdown was implemented using a macro on the sheet. (plz refer sample).
The issue i am facing is that one can select the same value from the list again and again.
example:
say the drop down contains these values: OC,CC,WC,ID.
The user first selects the value OC in cell D2. The cell gets the value OC.
Now he selects value CC from the dropdown, the cell value becomes "OC; CC"
Next if he select OC again, the cell value becomes "OC; CC; OC".
This is an error and shouldnt be accepted.
Also i gathered this method can be used to determine whether the new value is already present in the cell or not.
the formula is:
=IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, FALSE))))
now instead of D2 we have to use the target cell (the way it is used in the macro).
if a flag can be set which will check whether the <new_value> is already present withing the <target_cell>; and if it is TRUE (it is present) it can give an error dialog box saying "select unique values"; the solution can be achieved.
Can you guys please have a look at it.
I am attaching the sample also for reference.
Thanks in advance.
I have implemented a multiselect dropdown list. This list basically allows a user to select multiple values in a cell seperated by a semi-colon. The multi-select dropdown was implemented using a macro on the sheet. (plz refer sample).
The issue i am facing is that one can select the same value from the list again and again.
example:
say the drop down contains these values: OC,CC,WC,ID.
The user first selects the value OC in cell D2. The cell gets the value OC.
Now he selects value CC from the dropdown, the cell value becomes "OC; CC"
Next if he select OC again, the cell value becomes "OC; CC; OC".
This is an error and shouldnt be accepted.
Also i gathered this method can be used to determine whether the new value is already present in the cell or not.
the formula is:
=IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, IF(ISNUMBER(SEARCH("<new_value>",D2)), TRUE, FALSE))))
now instead of D2 we have to use the target cell (the way it is used in the macro).
if a flag can be set which will check whether the <new_value> is already present withing the <target_cell>; and if it is TRUE (it is present) it can give an error dialog box saying "select unique values"; the solution can be achieved.
Can you guys please have a look at it.
I am attaching the sample also for reference.
Thanks in advance.