公告
财富商城
积分规则
提问
发文
2019-09-13 02:38发布
可以哭但决不认输i
I want to check spelling in all labels that I have in a user form in VBA.
I would appreciate it if anyone could help me.
Private Sub UserForm_Initialize() Dim ctrl As Object For Each ctrl In Me.Controls If TypeName(ctrl) = "Label" Then With ctrl If Not Application.CheckSpelling(.Caption) Then .ForeColor = vbRed .BackColor = vbYellow End If End With End If Next End Sub
最多设置5个标签!