I dynamically defined checkboxes, which are added to the userform on runtime.
Sub Userform_Initialize()
For i = 1 To 4
Set Chk = Frame4.Controls.Add("Forms.Checkbox.1", "Checkbox" & i)
With Chk
.top = 84 + k
.left = 336
.Width = 100
.Height = 18
.Caption = "Add item"
.Visible = True
End With
k = k + 24
Next i
End Sub
Public WithEvents Chk As MSForms.CheckBox
Private Sub Chk_Click()
MsgBox Chk
End Sub
For some reason, the event doesn't respond. Does anyone have an idea as to why? I need the boolean of the checkbox. That means when the user clicked on a dynamic checkbox, then I see "True" returned in the msgbox.