Passing Arguments to Method registered with onAction Event(VBA - Excel)

后端 未结 3 964
死守一世寂寞
死守一世寂寞 2021-01-19 07:19

How do you pass an argument to a method which is registered with the onAction event in Excel VBA?

The code I have is:

With ActiveSheet.CheckBoxes.Add         


        
3条回答
  •  没有蜡笔的小新
    2021-01-19 07:59

    The Excel.Checkbox control has the property LinkedCell. Set this property to the value of rCell.Address or the like. Set OnAction to the CheckboxChange macro. To get the clicked checkbox, use Evaluate(Application.Caller) inside of CheckboxChange. Application.Caller will be the checkbox's name, and Evaluate returns the checkbox object itself. Using this object you can get its Name or LinkedCell.

提交回复
热议问题