T
TWhizTom
I am spellchecking a range (based on the current active sheet name). The
range is multi-rowed, but single column. When user clicks check spelling, it
unprotects the sheet spell checks the range and re-protects the sheet.
The issue is with some of these ranges there are over 50 often 100 rows. A
user may not be able to figure out what their spelling mistake was because
the error is not highlighted, therefore, the context of the spelling error is
lost...
How can I activate the cell or highlight the misspelled word? Code Example
follows:
<code>
Sub Spelling()
QuickUnprotect
Application.EnableEvents = False
Select Case ActiveSheet.Name
Case "Cover"
Range("Cover_SpellCheck").CheckSpelling
Case "FacilityData"
Range("Facility_CheckSpell").CheckSpelling
Case "4.0"
Range("QSR_SpellCheck").CheckSpelling
strHidden = Range("QSR_AuditorComments").EntireColumn.Hidden
Range("QSR_AuditorComments").EntireColumn.Hidden = False
Range("QSR_AuditorComments").CheckSpelling
Range("QSR_AuditorComments").EntireColumn.Hidden = True
Range("QSR_AuditorComments").EntireColumn.Hidden = strHidden
Range("QSR_4_2_Comment").Select
Case "5.0"
Range("Mgmt_Spellcheck").CheckSpelling
strHidden = Range("Mgmt_AuditorComments").EntireColumn.Hidden
Range("Mgmt_AuditorComments").EntireColumn.Hidden = False
Range("Mgmt_AuditorComments").CheckSpelling
Range("Mgmt_AuditorComments").EntireColumn.Hidden = True
Range("Mgmt_AuditorComments").EntireColumn.Hidden = strHidden
Case "6.0"
Range("Res_Spellcheck").CheckSpelling
strHidden = Range("Res_AuditorComments").EntireColumn.Hidden
Range("Res_AuditorComments").EntireColumn.Hidden = False
Range("Res_AuditorComments").CheckSpelling
Range("Res_AuditorComments").EntireColumn.Hidden = True
Range("Res_AuditorComments").EntireColumn.Hidden = strHidden
Case "7.0"
Range("Prod_Spellcheck").CheckSpelling
strHidden = Range("Prod_AuditorComments").EntireColumn.Hidden
Range("Prod_AuditorComments").EntireColumn.Hidden = False
Range("Prod_AuditorComments").CheckSpelling
Range("Prod_AuditorComments").EntireColumn.Hidden = True
Range("Prod_AuditorComments").EntireColumn.Hidden = strHidden
Case "8.0"
Range("Meas_Spellcheck").CheckSpelling
strHidden = Range("Meas_AuditorComments").EntireColumn.Hidden
Range("Meas_AuditorComments").EntireColumn.Hidden = False
Range("Meas_AuditorComments").CheckSpelling
Range("Meas_AuditorComments").EntireColumn.Hidden = True
Range("Meas_AuditorComments").EntireColumn.Hidden = strHidden
Case "Summary"
Range("Sum_SpellCheck").CheckSpelling
End Select
QuickProtect
Application.EnableEvents = True
MsgBox "SpellCheck Complete", vbOKOnly, "Spelling"
End Sub
</code>
range is multi-rowed, but single column. When user clicks check spelling, it
unprotects the sheet spell checks the range and re-protects the sheet.
The issue is with some of these ranges there are over 50 often 100 rows. A
user may not be able to figure out what their spelling mistake was because
the error is not highlighted, therefore, the context of the spelling error is
lost...
How can I activate the cell or highlight the misspelled word? Code Example
follows:
<code>
Sub Spelling()
QuickUnprotect
Application.EnableEvents = False
Select Case ActiveSheet.Name
Case "Cover"
Range("Cover_SpellCheck").CheckSpelling
Case "FacilityData"
Range("Facility_CheckSpell").CheckSpelling
Case "4.0"
Range("QSR_SpellCheck").CheckSpelling
strHidden = Range("QSR_AuditorComments").EntireColumn.Hidden
Range("QSR_AuditorComments").EntireColumn.Hidden = False
Range("QSR_AuditorComments").CheckSpelling
Range("QSR_AuditorComments").EntireColumn.Hidden = True
Range("QSR_AuditorComments").EntireColumn.Hidden = strHidden
Range("QSR_4_2_Comment").Select
Case "5.0"
Range("Mgmt_Spellcheck").CheckSpelling
strHidden = Range("Mgmt_AuditorComments").EntireColumn.Hidden
Range("Mgmt_AuditorComments").EntireColumn.Hidden = False
Range("Mgmt_AuditorComments").CheckSpelling
Range("Mgmt_AuditorComments").EntireColumn.Hidden = True
Range("Mgmt_AuditorComments").EntireColumn.Hidden = strHidden
Case "6.0"
Range("Res_Spellcheck").CheckSpelling
strHidden = Range("Res_AuditorComments").EntireColumn.Hidden
Range("Res_AuditorComments").EntireColumn.Hidden = False
Range("Res_AuditorComments").CheckSpelling
Range("Res_AuditorComments").EntireColumn.Hidden = True
Range("Res_AuditorComments").EntireColumn.Hidden = strHidden
Case "7.0"
Range("Prod_Spellcheck").CheckSpelling
strHidden = Range("Prod_AuditorComments").EntireColumn.Hidden
Range("Prod_AuditorComments").EntireColumn.Hidden = False
Range("Prod_AuditorComments").CheckSpelling
Range("Prod_AuditorComments").EntireColumn.Hidden = True
Range("Prod_AuditorComments").EntireColumn.Hidden = strHidden
Case "8.0"
Range("Meas_Spellcheck").CheckSpelling
strHidden = Range("Meas_AuditorComments").EntireColumn.Hidden
Range("Meas_AuditorComments").EntireColumn.Hidden = False
Range("Meas_AuditorComments").CheckSpelling
Range("Meas_AuditorComments").EntireColumn.Hidden = True
Range("Meas_AuditorComments").EntireColumn.Hidden = strHidden
Case "Summary"
Range("Sum_SpellCheck").CheckSpelling
End Select
QuickProtect
Application.EnableEvents = True
MsgBox "SpellCheck Complete", vbOKOnly, "Spelling"
End Sub
</code>