Engineer123
New Member
- Joined
- Nov 21, 2019
- Messages
- 8
I have over a dozen checkboxes. They are titled checkbox1, checkbox2, checkbox3... etc. They each have a sub routine that tells them what to do when click. These subroutines are identical except for the number that indexes each checkbox. While this was easy to create using copy/paste. It is messy and very difficult to debug, and may get unreasonable should I have to add more checkboxes. My question is...
…is there anyway to have one subroutine that governs all of them? Something like...
Private Sub Checkbox{n}
msgbox( "You have clicked on the " & n & "th checkbox.")
End Sub
Is it possible to have one subroutine that is triggered by any checkbox, and knows which checkbox triggered it?
Thank you.
…is there anyway to have one subroutine that governs all of them? Something like...
Private Sub Checkbox{n}
msgbox( "You have clicked on the " & n & "th checkbox.")
End Sub
Is it possible to have one subroutine that is triggered by any checkbox, and knows which checkbox triggered it?
Thank you.