【问题标题】:Excel VBA Combo Box returning index not valueExcel VBA组合框返回索引不是值
【发布时间】:2012-04-05 12:53:27
【问题描述】:

我在 Excel 2007 中设置了一个组合框,它从另一个工作表中收集其列表项。当我尝试通过宏访问所选项目的值时,返回的只是索引值而不是实际值。

DateDropDown = Sheets("Input Form").Shapes("APPDateDropDown").ControlFormat.Value

组合框中的值被列为“Jan-12”,但是当我运行上面的代码时 DateDropDown 返回为 37(项目的索​​引)。

如何让它返回值“Jan-12”?

【问题讨论】:

    标签: combobox excel vba


    【解决方案1】:
    With Sheets("Input Form").Shapes("APPDateDropDown")
        DateDropDown = .ControlFormat.List(.ControlFormat.ListIndex)
    End With
    

    【讨论】:

    • 非常感谢!!正在把我的头撞到墙上。
    • 是的,表单控件有时会很痛苦 :)
    猜你喜欢
    • 1970-01-01
    • 2011-10-25
    • 2015-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多