Spell Check Single Cell??

robfo0

Active Member
Joined
Feb 19, 2002
Messages
281
Hi everyone,

I did a search and came up with this code from Paul B's post:
Code:
Sub Spell_Check() 
ActiveSheet.Unprotect 
Cells.CheckSpelling CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False _ 
, AlwaysSuggest:=True 
ActiveSheet.Protect 
End Sub
I DO want the spell check to pop up and suggest changes as this code does, but is it possible to have it check ONLY one cell? I tried replacing "cells" with "Range("A1")", but it still checks the whole page.

I would really appreciate some help if this is even possible (I hope it is!)

Thanks,

Robert
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Double click in cell, press F7. This will only check spelling in the active cell.[/quote]
 
Upvote 0
Hi robfo0,
I haven't tried Juan's (or Murtle's) solutions but I spell check one cell by actually selecting the cell first and then spell checking the selection. As in:
Range("A1").Select
Selection.CheckSpelling CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False _
, AlwaysSuggest:=True, SpellLang:=1033

This works well for me...
HalfAce
 
Upvote 0
I know it's a very old post, however to explicitly spellcheck a specific range of cells use:

Check spelling has the following layout:
(CustomDictionary, IgnoreUppercase, AlwaysSuggest, SpellLang)
all of these are optional.
aparrently 2057 is the LanguageID of English UK.......

Code:
'spell check one cell
With Range("A1")
    Call .CheckSpelling("CUSTOM.DIC", False, True, 2057)
End With

'spell check a group of cells
With Range("A1:A2").
    Call .CheckSpelling("CUSTOM.DIC", False, True, 2057)
End With

'spell check an entire column (or columns)
With Range("A:A")
    Call .CheckSpelling("CUSTOM.DIC", False, True, 2057)
End With

'spell check an entire row (or rows)
With Range("1:1")
    Call .CheckSpelling("CUSTOM.DIC", False, True, 2057)
End With
Obviously you can also construct a custom range by using:
(very very useful when working within loops)
Code:
Range(Sheet.Cells(Row,Col),Sheet.Cells(Row,Col))

'sheet is either ThisWorkbook.Sheets("SheetName") or the explicit name 
of the sheet object in the VBA explorer.
 
Upvote 0
Try using this:
Do not insert it as a module but as a microsoft Excel object.
to do this....right click the sheet you want to apply it to and view code.
Copy and paste below code...+ Enjoy dynamic single cell spell checking


Private Sub Worksheet_Change(ByVal Target As Range)
With ActiveCell
Selection.Offset(-1, 0).Select
ActiveCell.CheckSpelling SpellLang:=2057
End With
End sub
 
Upvote 0
Try using this:
Do not insert it as a module but as a microsoft Excel object.
to do this....right click the sheet you want to apply it to and view code.
Copy and paste below code...+ Enjoy dynamic single cell spell checking


Private Sub Worksheet_Change(ByVal Target As Range)
Range(Target.Address).CheckSpelling SpellLang:=2057
End sub




if you want to apply this to a specific column then use:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 5 Then
Range(Target.Address).CheckSpelling SpellLang:=2057
End If
End sub
 
Last edited:
Upvote 0
Here's my complete solution:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Locked Then Exit Sub
    If Target.Text <> vbNullString Then
        '*********************************************************************************************************
        'EXCEL SINGLE-CELL SPELL CHECK BUG WORKAROUND - BUG WORKAROUND - BUG WORKAROUND - BUG WORKAROUND - BUG
        '
        'Excel has an annoying bug in which, if the CheckSpelling method is called for a single cell or merged
        'range, it continues spell-checking the rest of the sheet.  The cleanest workaround is to specify multiple
        'cells (which suppresses the automatic continuation functionality) but with two cells that are actually
        'the same cell.  Note that the specification must be a union of two cells (using the "," operator), not a
        'multi-cell range.  Also, any possible merged-area must be explicitly handled.
        
        Dim FullTargetAddr As String
        
        Application.EnableEvents = False    'Disable events in case of multiple spelling errors, in which case
                                            'this event handler would be re-triggered on each spelling-fix event.
                                            '(But no need to save its state because this is an event handler)
                                            
        FullTargetAddr = Target.Resize(1, 1).MergeArea.Address 'If merged, must use the full merged-range address,
                                                               'not just its first cell!
        Range(FullTargetAddr & ", " & FullTargetAddr).CheckSpelling
        
        Application.EnableEvents = True
        
        'END WORKAROUND - END WORKAROUND - END WORKAROUND - END WORKAROUND - END WORKAROUND - END WORKAROUND - END
        '*********************************************************************************************************
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,834
Messages
6,127,163
Members
449,368
Latest member
JayHo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top