How to self refer to current control - checkbox (1 Viewer)

essaytee

Need a good one-liner.
Local time
Today, 21:36
Joined
Oct 20, 2008
Messages
512
Hope someone can help. I've been given an Excel spreadsheet and asked to clean it up as it's not doing what it's supposed to. It's a Leave Roster spreadsheet.

What has happened is that 67 checkboxes have been added to individual cells, in the same column.



Each checkbox is named, CheckBox1, CheckBox11 etc. the default names. The checkboxes have been entered haphazardly, not one after the other, going down the column.

Within the click event of each Checkbox, the underlying cell of the Checkbox is set to either true or false, corresponding to the Checkbox value. Now the problem is, when setting the underlying cell, all references are hardcoded eg. (Range("B23").Value), but I soon found out that some of the Checkboxes and Underlying cells do not match up.

Within the click event of the Checkbox, how do I refer to the Checkbox itself. I have already figured out how to determine current row and column but just can't generically reference the Checkbox control.

Any help appreciated.
 

Attachments

  • 2019-04-08_19-54-24.jpg
    2019-04-08_19-54-24.jpg
    33.8 KB · Views: 262

Users who are viewing this thread

Top Bottom