我有一个带有动态添加的复选框的Excel用户窗体。
我使用类似以下代码添加复选框:
Set chkBox = Me.Controls.Add("Forms.Checkbox.1", "Checkbox" & i)
我想要移除所有这些复选框。
Dim j As Integer
'Remove all dynamically updated checkboxes
For Each cont In Me.Controls
For j = 1 To NumControls
If cont.Name = "Checkbox" & j Then
Me.Controls.Remove ("Checkbox" & j)
End If
Next j
Next cont
我收到了以下错误信息:
On error resume next
来处理这些事情。 - Patrick Lepelletier