![]() |
|
#1
|
|||
|
|||
![]()
vivka,
Your code is better (fixes the problems), but looking at every word regardless if spelled wrong or not, could take a long time in large documents. I mean why back up one word at at time? Try: Code:
Sub FindPreviousMisspelledWord() Dim oRng As Range Set oRng = Selection.Range With oRng While .Start <> 0 .Collapse 1 .Start = ActiveDocument.Range.Start .MoveStart wdWord, -1 If .SpellingErrors.Count > 0 Then .SpellingErrors(.SpellingErrors.Count).Select Exit Sub End If Wend End With MsgBox "No misspelled words found." lbl_Exit: Exit Sub End Sub |
#2
|
|||
|
|||
![]() Quote:
Thank you so much! And yes, yours run faster. |
![]() |
Tags |
loop, range, spell check |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
laith93 | Word VBA | 2 | 11-07-2021 12:52 AM |
Error with macro to delete starting #) [code included] | puff | Word VBA | 1 | 04-18-2018 03:49 PM |
![]() |
puff | Word VBA | 5 | 01-17-2018 04:32 PM |
![]() |
puff | Word VBA | 5 | 12-17-2017 05:52 PM |
Outlook 2003 - if previous meesage included in reply, spell checks all | wildswing | Outlook | 0 | 07-22-2009 06:06 AM |