' MyRangeSpell.CheckSpelling line of code works for first not for second With Block
Public Sub AutoSpellCheck()
Dim wdApp As Object
Dim wdDoc As Object
Dim wdRng As Object
Dim wdRngIndex As Object
Dim MyRangeSpell As Range
Dim sMsg As String
Dim bOldOption As Boolean
Dim rCell As Excel.Range
Dim sTextToCheck As String
Application.ScreenUpdating = False
'On Error Resume Next
With Sheets("HP")
Worksheets("HP").Activate
Set MyRangeSpell = ActiveSheet.Range(Cells(28, 28), Cells((Range("B28:B28").End(xlDown).Row), (Range("B28:B28").End(xlToRight).Column)).Address)
MyRangeSpell.CheckSpelling
End With
With Sheets("D")
Worksheets("D").Activate
Set MyRangeSpell = ActiveSheet.Range(Cells(59, 59), Cells((Range("A59:A59").End(xlDown).Row), (Range("A59:A59").End(xlToRight).Column)).Address)
MyRangeSpell.CheckSpelling
End With
End Sub
Bookmarks