How do I refer to a controls object, on a worksheet, using a variable name?

后端 未结 4 1946
慢半拍i
慢半拍i 2021-01-11 20:06

I have added a ListBox to a SHEET (not to a \"UserForm\") I did this using the mouse. I clicked the little Hammer and Wrench icon.

This ListBox seems to be easily re

4条回答
  •  清歌不尽
    2021-01-11 20:47

    To access the state of a checkbox Active-X control on Sheet1:

    Dim checkBox1 As Object
    Set checkBox1 = Sheet1.OLEObjects("CheckBox1").Object
    MsgBox checkBox1.Value
    

提交回复
热议问题