VBA中清除文本框和复合框中的内容
VBA中清除文本框和复合框中的内容,我写的代码是:PrivateSubCommandButton6_Click()DimrngAsControlForEachrngInu...
VBA中清除文本框和复合框中的内容,我写的代码是:
Private Sub CommandButton6_Click()
Dim rng As Control
For Each rng In userform1.Controls
If TypeName(rng) = "textbox" Then
rng.Text = ""
End If
If TypeName(rng) = "combobox" Then
rng.Text = ""
End If
Next rng
End Sub
运行后,始终不起作用,请高人指点! 展开
Private Sub CommandButton6_Click()
Dim rng As Control
For Each rng In userform1.Controls
If TypeName(rng) = "textbox" Then
rng.Text = ""
End If
If TypeName(rng) = "combobox" Then
rng.Text = ""
End If
Next rng
End Sub
运行后,始终不起作用,请高人指点! 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询