none
How to add a drop down list using VBA RRS feed

  • Question

  • Question content :Hi, I'm new to VBA. I wana to create a DDL in Excel. Does anyone know this? Thanks. 
    Friday, August 17, 2018 8:53 AM

Answers

  • Hi,

    Please try this code:

    With Selection.Validation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:="Value1;Value2;Value3"
            .IgnoreBlank = True
            .InCellDropdown = True
            .InputTitle = ""
            .ErrorTitle = ""
            .InputMessage = ""
            .ErrorMessage = ""
            .ShowInput = True
            .ShowError = True
        End With
    Also, you could be reference this video which how to record a macro for DDL.

    Hope it helps you. 


    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.

    • Marked as answer by Nicholasmin Friday, August 17, 2018 9:15 AM
    Friday, August 17, 2018 8:58 AM
    Moderator

All replies

  • Hi,

    Please try this code:

    With Selection.Validation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
            xlBetween, Formula1:="Value1;Value2;Value3"
            .IgnoreBlank = True
            .InCellDropdown = True
            .InputTitle = ""
            .ErrorTitle = ""
            .InputMessage = ""
            .ErrorMessage = ""
            .ShowInput = True
            .ShowError = True
        End With
    Also, you could be reference this video which how to record a macro for DDL.

    Hope it helps you. 


    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.

    • Marked as answer by Nicholasmin Friday, August 17, 2018 9:15 AM
    Friday, August 17, 2018 8:58 AM
    Moderator
  • Got it. Thanks a lot.
    Friday, August 17, 2018 9:10 AM
  • Thanks for you asking. If help you, please mark the post as an answer and close the post. 

    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.

    Friday, August 17, 2018 9:13 AM
    Moderator