【问题标题】:Spelling check in user form in VBAVBA中用户表单中的拼写检查
【发布时间】:2016-12-22 07:06:36
【问题描述】:

我想检查 VBA 用户表单中所有标签的拼写。

如果有人可以帮助我,我将不胜感激。

【问题讨论】:

    标签: excel spelling vba


    【解决方案1】:

    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"
    • 那是两条单独的行。看看我的回答。我修复了它的代码格式。
    • 我该怎么办:错误:“预期语句结束”
    • 太棒了!很高兴我能提供帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-09
    • 1970-01-01
    • 2018-04-30
    • 2020-09-11
    • 2015-10-17
    • 2011-02-12
    • 2010-12-28
    相关资源
    最近更新 更多