I am trying to create a macro that will run spell check on multiple protected sheets. Here is the code I have now that seems to just catch the Activesheets spelling errors, but then unprotects and then reprotects the remaining sheets without catching spelling errors in the defined ranges.
Code:
Sub SpellCheckIt()
ActiveSheet.Unprotect ("")
Range("B17", "B68:B147").CheckSpelling
ActiveSheet.Protect ("")
With Sheet4
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet6
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet8
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet10
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet12
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet14
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet16
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet18
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet20
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet22
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet24
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet26
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet28
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet30
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet32
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet34
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet36
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet38
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet40
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet42
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet44
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet45
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet46
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet47
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet49
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet50
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet51
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet52
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet53
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet54
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet55
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet56
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet57
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet58
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet59
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet60
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet61
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet62
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet48
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
With Sheet43
.Unprotect ("")
.Range("B22", "B31").CheckSpelling
.Protect ("")
End With
End Sub