开发者

Excel 2011 Mac VBA Combobox value

开发者 https://www.devze.com 2023-02-16 07:46 出处:网络
In excel 2011 on the mac, I have a spread sheet with two controls. A combobox and a button. the combo box is named Crops and i want to access the value of that box when clicking the button.

In excel 2011 on the mac, I have a spread sheet with two controls. A combobox and a button. the combo box is named Crops and i want to access the value of that box when clicking the button.

The obvious Crops.Value that would work in windows office does not seem to work and i get an error saying the Crops obje开发者_开发技巧ct is missing.

Is this (simple) task possible with VBA on the Mac?


ok solved it. Active X objects do not work on the mac. You have to use Forms elements and then if you want to access the value of a dropdown this is the VBA code. Hope it helps someone else.

assuming Crops was the combobox, Itm will have the value.

With ActiveSheet.DropDowns("Crops")
    Itm = .list(.ListIndex)
End With
0

精彩评论

暂无评论...
验证码 换一张
取 消