Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default VBA Check Spelling doesn't highlight misspelled word

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default VBA Check Spelling doesn't highlight misspelled word

If you care to correct errors as you go, either of these may work for you?

Sub SpellDown()
Do
ActiveCell.Offset(1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellUp
End Sub

Sub SpellUp()
Do
ActiveCell.Offset(-1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellDown
End Sub

HTH,
Ryan---

--
RyGuy


"TWhizTom" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default VBA Check Spelling doesn't highlight misspelled word

Thanks Ryan,

However, I don't want to check the whole sheet, just the named ranges. I
have not tried your code, but it does not appear to check the named ranges
only.
--

Tech Whiz Tom
MS Access / Excel Applications Analyst


"ryguy7272" wrote:

If you care to correct errors as you go, either of these may work for you?

Sub SpellDown()
Do
ActiveCell.Offset(1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellUp
End Sub

Sub SpellUp()
Do
ActiveCell.Offset(-1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellDown
End Sub

HTH,
Ryan---

--
RyGuy


"TWhizTom" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default VBA Check Spelling doesn't highlight misspelled word

I don't have time to modify the code right now, and it would be a little
difficult for me to do so because I don't have all those named ranges that
you have. Anyway, I think the macro will do what you want, once you change
it to look at the named ranges you specified. Or, just run it as is. How
much more time could it possible take to check cells that are not within the
named ranges, assuming there aren't lots and lots of spelling mistakes to
begin with.

HTH,
Ryan---


--
RyGuy


"TWhizTom" wrote:

Thanks Ryan,

However, I don't want to check the whole sheet, just the named ranges. I
have not tried your code, but it does not appear to check the named ranges
only.
--

Tech Whiz Tom
MS Access / Excel Applications Analyst


"ryguy7272" wrote:

If you care to correct errors as you go, either of these may work for you?

Sub SpellDown()
Do
ActiveCell.Offset(1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellUp
End Sub

Sub SpellUp()
Do
ActiveCell.Offset(-1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellDown
End Sub

HTH,
Ryan---

--
RyGuy


"TWhizTom" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default VBA Check Spelling doesn't highlight misspelled word

Thanks again ryan,

Do not expect you to rebuild it ( lol ). I will take a look at using your
code or modifying. But, is looking more and more like going to have to setup
a for next and loop through the range and copy if not hidden.... It appears
that the merged cells are causing the .specialcells(xlcelltypevisible) to not
work.

Checking the additional areas is not an option. There is not lot nor is time
the issue, but there are a lot of industrial terms, acronmyns, and
abbreviations that are going to pop the spell check box....

Thanks for trying!
--

Tech Whiz Tom
MS Access / Excel Applications Analyst


"ryguy7272" wrote:

I don't have time to modify the code right now, and it would be a little
difficult for me to do so because I don't have all those named ranges that
you have. Anyway, I think the macro will do what you want, once you change
it to look at the named ranges you specified. Or, just run it as is. How
much more time could it possible take to check cells that are not within the
named ranges, assuming there aren't lots and lots of spelling mistakes to
begin with.

HTH,
Ryan---


--
RyGuy


"TWhizTom" wrote:

Thanks Ryan,

However, I don't want to check the whole sheet, just the named ranges. I
have not tried your code, but it does not appear to check the named ranges
only.
--

Tech Whiz Tom
MS Access / Excel Applications Analyst


"ryguy7272" wrote:

If you care to correct errors as you go, either of these may work for you?

Sub SpellDown()
Do
ActiveCell.Offset(1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellUp
End Sub

Sub SpellUp()
Do
ActiveCell.Offset(-1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellDown
End Sub

HTH,
Ryan---

--
RyGuy


"TWhizTom" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
r c r c is offline
external usenet poster
 
Posts: 1
Default .checkSpelling is the problem

I have had this same problem, but have finally figured out that if you use .checkSpelling in vba then it will not update your screen while spell checking even if you have application.screenupdating = true.

In order to get around this you can invoke the spell checking command from the command bar. In one instance i needed to have Application.ScreenUpdating = True on and one i didn't, but having it on doesn't hurt anything most of the time..

Something like:

rangeToCheck.Select
Application.ScreenUpdating = True
Application.CommandBars("Tools").Controls("Spellin g...").Execute



TWhizTo wrote:

VBA Check Spelling doesn't highlight misspelled word
16-Mar-09

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

Previous Posts In This Thread:

On Monday, March 16, 2009 12:18 PM
TWhizTo wrote:

VBA Check Spelling doesn't highlight misspelled word
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

On Monday, March 16, 2009 2:09 PM
ryguy727 wrote:

If you care to correct errors as you go, either of these may work for you?
If you care to correct errors as you go, either of these may work for you?

Sub SpellDown()
Do
ActiveCell.Offset(1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellUp
End Sub

Sub SpellUp()
Do
ActiveCell.Offset(-1, 0).Select
ActiveCell.CheckSpelling SpellLang:=1033, _
AlwaysSuggest:=True
On Error GoTo Right
Loop
Right:
ActiveCell.Offset(0, 1).Select
SpellDown
End Sub

HTH,
Ryan---

--
RyGuy


"TWhizTom" wrote:

On Monday, March 16, 2009 2:27 PM
TWhizTo wrote:

Thanks Ryan,However, I don't want to check the whole sheet, just the named
Thanks Ryan,

However, I don't want to check the whole sheet, just the named ranges. I
have not tried your code, but it does not appear to check the named ranges
only.
--

Tech Whiz Tom
MS Access / Excel Applications Analyst


"ryguy7272" wrote:

On Monday, March 16, 2009 6:23 PM
ryguy727 wrote:

I don't have time to modify the code right now, and it would be a little
I don't have time to modify the code right now, and it would be a little
difficult for me to do so because I don't have all those named ranges that
you have. Anyway, I think the macro will do what you want, once you change
it to look at the named ranges you specified. Or, just run it as is. How
much more time could it possible take to check cells that are not within the
named ranges, assuming there aren't lots and lots of spelling mistakes to
begin with.

HTH,
Ryan---


--
RyGuy


"TWhizTom" wrote:

On Tuesday, March 17, 2009 10:55 AM
TWhizTo wrote:

Thanks again ryan,Do not expect you to rebuild it ( lol ).
Thanks again ryan,

Do not expect you to rebuild it ( lol ). I will take a look at using your
code or modifying. But, is looking more and more like going to have to setup
a for next and loop through the range and copy if not hidden.... It appears
that the merged cells are causing the .specialcells(xlcelltypevisible) to not
work.

Checking the additional areas is not an option. There is not lot nor is time
the issue, but there are a lot of industrial terms, acronmyns, and
abbreviations that are going to pop the spell check box....

Thanks for trying!
--

Tech Whiz Tom
MS Access / Excel Applications Analyst


"ryguy7272" wrote:


Submitted via EggHeadCafe - Software Developer Portal of Choice
Book Review: C# 4.0 In a Nutshell [O'Reilly]
http://www.eggheadcafe.com/tutorials...c-40-in-a.aspx
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
check spelling as you type dp New Users to Excel 5 February 3rd 10 07:00 PM
Can excel underline misspelled words like Word? Dave Excel Discussion (Misc queries) 1 April 5th 06 09:39 PM
... Can I set Spell Check to automatically check my spelling ... Dr. Darrell Setting up and Configuration of Excel 0 March 21st 06 08:26 PM
Spelling check in excel r Excel Programming 0 May 18th 05 10:13 AM
Spelling check Mark Excel Programming 1 August 5th 04 09:24 AM


All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"