Selecting a specific item from Dropdown in excel vba

后端 未结 2 1621
小蘑菇
小蘑菇 2021-01-22 13:38

I\'m working out a dashboard for my office. It all works, but I wanted to add in an option that instead of searching through 250+ items in a dropdown, you could also click on a

2条回答
  •  旧巷少年郎
    2021-01-22 13:53

    If you are using an ActiveX drop down list, (a combobox) this is how you would change the selected value in the drop down list:

    ComboBox1.Value = "New Value"
    

    If you are using data validation as a drop down list, then you just need to change the cell value as you would change any other cell:

    'assuming the drop down list (data validation) is in Cell(1, 1)
    cells(1,1) = "New Value"
    

    Also you could check this article I've written on my blog about working with drop down lists in VBA Excel VBA Drop Down Lists

提交回复
热议问题