要检查特定单元格中的拼写,请尝试:
Sub bbuller() Dim boo As Boolean s = Array("Invoice!D15", "Invoice!D16", "Invoice!D17", "Invoice!D18", "Invoice!D19", "'Safety Inspection'!D38") For Each ss In s boo = CheckItNew(Range(ss)) If boo Then MsgBox ss & " has no errors" Else MsgBox ss & " has errors" End If Next ss End Sub Public Function CheckItNew(r As Range) As Boolean Dim MyText As String MyText = r(1).Text Dim oxlAp As Object Set oxlAp = CreateObject("Excel.Application") CheckItNew = oxlAp.CheckSpelling(MyText) oxlAp.Quit Set oxlAp = Nothing End Function