Spellcheck a single word in Excel function

前端 未结 5 409
不知归路
不知归路 2021-01-11 12:32

This little Excel VBA function always returns false, no what word is passed in.

Function SpellCheck(SomeWord As String)

SpellCheck = Application.CheckSpelli         


        
5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-11 12:46

    You are correct about the UDF. This little jobber helps though.

    Sub SpellCheckColumn()
        Dim rRng As Range
    
        Set rRng = Range("A1", Range("A" & Rows.Count).End(xlUp))
    
        For Each rCell In rRng
        If Not Application.CheckSpelling(rCell) Then
            rCell.Offset(, 1) = "Checkspell Error"
        Next rCell
    End Sub
    

提交回复
热议问题