none
Excel Drop Down -menu / macro RRS feed

  • Question

  • Hello

    I have updated to newest excel version.

    I  have a  one file with two worksheets, one lists component options and other has drop down menu to select the desired component. Now with new excel version the drop down menu doesn't work anymore --> cannot open the menu or select anything from it. And any macros don't work. I have tried enabling all macros. Any tips?

    BR

    Markus

    Monday, November 5, 2018 12:23 PM

All replies

  • Hi Markus,

    The following code allows us to select multiple items from the drop-down list:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    
    ' To make mutliple selections in a Drop Down List in Excel
    
    Dim Oldvalue As String
    Dim Newvalue As String
    
    On Error GoTo Exitsub
    If Target.Address = "$C$2" Then
        If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
        GoTo Exitsub
        Else: If Target.Value = "" Then GoTo Exitsub Else
            Application.EnableEvents = False
            Newvalue = Target.Value
            Application.Undo
            Oldvalue = Target.Value
            If Oldvalue = "" Then
                Target.Value = Newvalue
            Else
                Target.Value = Oldvalue & ", " & Newvalue
            End If
        End If
    End If
    Application.EnableEvents = True
    Exitsub:
    Application.EnableEvents = True
    End Sub

    For more information, please see the following links:

    VBA Code to allow Multiple Selections in a Drop-down List (with repetition)

    Error when using a drop down to run macro

    Select Drop Down Item and use VLOOKUP to Return Multiple AttributesExcel VBA: DropDown Selct Macro Help

    Hopefully it helps you.

    Best Regards,

    Lina


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, November 6, 2018 2:34 AM
  • Hi Markus,

    Thanks for your asking. Please remember to mark the replies as answers if they helped and please help us close the thread.

     

    Thank you for understanding. If you have any question, or update, please feel free to let us know.

     

    I wish you a happy life!

     

    Best Regards,

     

    Lina


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Thursday, November 8, 2018 5:37 AM