texasalynn
Well-known Member
- Joined
- May 19, 2002
- Messages
- 8,458
I've almost got this but haven't found a way to get a checkbox (form type, not ActiveX) number. I have too many and want to avoid putting in those. Here is a sample of my current code. So the reference CheckBox1, I would like to have it be automatically determined so that I can use a variable in my code. Then I can make one generic code to work with each checkbox.
Code:
Option Explicit
Public SRC As String
Private Sub CheckBox1_Click()
Dim i As Variant
SRC = ActiveSheet.CodeName & "." & Right(CheckBox1.Name, Len(CheckBox1.Name) - 8)
ActiveCell.Offset(0, 4) = SRC
i = ActiveCell.Address
If i = True Then
Call Chkbx
End If
If i = False Then
Call RemoveLine
Range(i).Offset(0, 4).Clear
End If
End Sub