Hi guys. Has anyone encountered the need to implement a macro for multiple selection in a drop-down list? I have an example of implementing such a macro in VBA, but I can’t seem to convert it to JavaScript.
VBA realisation:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Not Intersect(Target, Range("AU2:AW10000000")) Is Nothing And Target.Cells.Count = 1 Then
Application.EnableEvents = False
newVal = Target
Application.Undo
oldval = Target
If Len(oldval) <> 0 And oldval <> newVal Then
Target = Target & ", " & newVal
Else
Target = newVal
End If
If Len(newVal) = 0 Then Target.ClearContents
Application.EnableEvents = True
End If
End Sub
hello, multiple selection list is also of interest to me,
I’ve found this article implementing Multiple selection dropdown list in Google Sheets using Google Apps Script, which is based on JavaScript - the article is pretty long and informative, can you take a look and share if similar approach can be used in OnlyOffice?
*taken from How to Make Multiple Selection in Drop-down Lists in Google Sheets
Unfortunately this code doesn’t work in ONLYOFFICE. Cells don’t have a method oldValue (At least I didn’t find anything like that in the documentation). I managed to implement remembering the old value of a cell, but it only works when executing the macro from the macro window, and nothing works in the worksheet itself
Hello @xaxatun4ik @dimitri
Unfortunately, possibility to select multiple items in a cell with applied Data Validation feature is not yet implemented. The enhancement suggestion is already registered, I’ve added your query to it. It will be added in one of the future releases but no ETA is available yet.