I have the following issue:
I have created an dynamic checklist that allows the user to utilize checkboxes to display the status of each line item within their overall project. However, I want to enable the user to be able to change the layout of the checklist and add/subtract checkboxes when needed. However, in the construction of the VBA code that I used to create the click event I was unable to avoid using the actual object's name in the code:
Private Sub CheckBox399_Click()
'Call Unprotect
xvarb = CheckBox399.Value
If xvarb = True Then
CheckBox399.TopLeftCell.Offset(0, 4).Activate
Call AddDetails
'Call Protect
Else
'Call Unprotect
CheckBox399.TopLeftCell.Offset(0, 4).Activate
Call ClearDetails
'Call Protect
End If
End Sub
Is there a way to allow the code to identify each checkbox dynamically, instead of specifically each box. As I have currently employed the code, I have to replicate the lines above out for each check box that appears on the sheet. There has to be a better way to acheive the same effect, except it is beyond my powers. Any info in the right direction would be of great help.
Thanks
RT
I have created an dynamic checklist that allows the user to utilize checkboxes to display the status of each line item within their overall project. However, I want to enable the user to be able to change the layout of the checklist and add/subtract checkboxes when needed. However, in the construction of the VBA code that I used to create the click event I was unable to avoid using the actual object's name in the code:
Private Sub CheckBox399_Click()
'Call Unprotect
xvarb = CheckBox399.Value
If xvarb = True Then
CheckBox399.TopLeftCell.Offset(0, 4).Activate
Call AddDetails
'Call Protect
Else
'Call Unprotect
CheckBox399.TopLeftCell.Offset(0, 4).Activate
Call ClearDetails
'Call Protect
End If
End Sub
Is there a way to allow the code to identify each checkbox dynamically, instead of specifically each box. As I have currently employed the code, I have to replicate the lines above out for each check box that appears on the sheet. There has to be a better way to acheive the same effect, except it is beyond my powers. Any info in the right direction would be of great help.
Thanks
RT