尝试使用
突出显示其中存在语法错误的单元格Sub ColorMispelledCells()
For Each cl In ActiveSheet.Range("E2:E7199")
**If Not Application.CheckSpelling(Word:=cl.Value) Then _**
cl.Interior.ColorIndex = 28
End If
Next cl
End Sub
由于某些原因在星号中突出显示的行因“类型错误”
而无法编译答案 0 :(得分:0)
这似乎有效:
Sub ColorMispelledCells()
Dim Ap As Object, c As String
Set Ap = CreateObject("Excel.Application")
Dim cl As Range, boo As Boolean
For Each cl In ActiveSheet.Range("E2:E7199")
c = cl.Text
If Not Ap.CheckSpelling(c) Then
cl.Interior.ColorIndex = 28
End If
Next cl
Set Ap = Nothing
End Sub