Selecting a specific item from Dropdown in excel vba

后端 未结 2 1595
小蘑菇
小蘑菇 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

    0 讨论(0)
  • 2021-01-22 14:02

    I wanted to do the same: Select an option from several drop down lists, then "reset" all of them to a starting point. Recording a macro and change the drop down list wont work.

    However, I did the following:

    • Start recording macro
    • I typed all the values I wanted to be the "starting point once reset on the drop down list
    • stop macro.

    It worked. Now I hit the macro and I get all the values "reset". Cheap trick, I know but worked for me.

    0 讨论(0)
提交回复
热议问题