【发布时间】:2021-12-09 07:20:07
【问题描述】:
我目前有一个在用户窗体背景故事上动态创建文本框的代码是here。
在代码中,它检查表单上的单个框架是否有控件,如果有任何被勾选,则运行以下代码:
Function Addcheckboxes(emailtype)
Dim Ctrl As Control
Dim cont As Control
Dim i As Long
Dim h As Long
Dim intAppCount As Integer
Dim result As Long
' Loop through all the applications that have been selected with the email type and then create the appropriate email template on the userform lower box
If SpnColct.Count > 0 Then removeDynamicControls
For Each Ctrl In Me.Frame4.Controls
If TypeOf Ctrl Is MSForms.CheckBox Then
If Ctrl = True Then
Call AddTextBox(Mid(Ctrl.Name, 4), emailtype)
intAppCount = intAppCount + 1
End If
End If
Next
If intAppCount > 1 Then Me.Frame3.Caption = "Email Templates"
End Function
如何扩展它以使其同时检查用户窗体上的第 4 帧和第 5 帧?
提前谢谢你
【问题讨论】:
标签: excel vba user-controls userform