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
【讨论】:
非常感谢,
"Private Sub UserForm_Initialize() Dim ctrl As Object"