VBA dropdown list

Kristina96

New Member
Joined
Sep 30, 2019
Messages
31
Hello everyone,

I want to add a dropdown list to a selection of cells. My code is adding a dropdown list to the cell but the list contains all the option as one. Meaning that instead of giving the chance to choose either option 1, option 2 or option 3 it gives only one option called "option 1; option 2; option 3".
My code:
Code:
With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="option 1; option 2; option 3"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = "Title"
        .ErrorTitle = ""
        .InputMessage = _
        "Test message" & Chr(10) & ""
        .ErrorMessage = ""
        .ShowInput = True
        .ShowError = True
    End With
Thank you in advance
Kristina
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
11,713
Office Version
365, 2010
Platform
Windows, Mobile
Change all your ; to , in your string.
 

Forum statistics

Threads
1,085,089
Messages
5,381,649
Members
401,747
Latest member
Jtvan

Some videos you may like

This Week's Hot Topics

Top