Check spelling in a single cell AND spellchecking values only

A

Anne CFS

I'm creating templates for users to use as reports - these have (among many
others) one merged cell which contains free text and of course the users
don't spell check.

I'm quite happy coding for spell checking before saving, but would prefer to
spellcheck only the relevant cell and I cannot get this to work. Code given
below:

Set wsActive = Worksheets("Current Status")
wsActive.Select
If Range("B24").Value <> "" Then
wsActive.Range("B24").CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
End If

This still checks the entire sheet, so I don't know what to do next. Also,
can I spellcheck only the value of this cell (Free entry text) without the
comment [which was added as short notes on the type of content required in
the cell].

Thanks in advance

Anne
 
T

Toppers

Hi,

Try this which ignores cooments (XL2003):

wsActive.Select
If Range("B24").Value <> "" Then
If Application.CheckSpelling(Word:=Range("b24"), _
CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False) = False Then
MsgBox ("Check spelling of " & Range("B24"))
End If
End If
 
A

Anne CFS

Hi Toppers

Thanks for code. I've tried it and it runs beautifully, but doesn't check
the spelling. No spellcheck dialog box and no correction of a host of
Scottish words which are definitely not in the English dictionary, but which
eloquently express my frustration with this!!!

I should have mentioned - I'm using XL2000.

Cheers!
Anne

Toppers said:
Hi,

Try this which ignores cooments (XL2003):

wsActive.Select
If Range("B24").Value <> "" Then
If Application.CheckSpelling(Word:=Range("b24"), _
CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False) = False Then
MsgBox ("Check spelling of " & Range("B24"))
End If
End If


Anne CFS said:
I'm creating templates for users to use as reports - these have (among many
others) one merged cell which contains free text and of course the users
don't spell check.

I'm quite happy coding for spell checking before saving, but would prefer to
spellcheck only the relevant cell and I cannot get this to work. Code given
below:

Set wsActive = Worksheets("Current Status")
wsActive.Select
If Range("B24").Value <> "" Then
wsActive.Range("B24").CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
End If

This still checks the entire sheet, so I don't know what to do next. Also,
can I spellcheck only the value of this cell (Free entry text) without the
comment [which was added as short notes on the type of content required in
the cell].

Thanks in advance

Anne
 
T

Toppers

Hi,

Cells.CheckSpelling SpellLang:=2057

Or

Range("a2").CheckSpelling SpellLang:=2057

Invokes Spellchecker and looks at all cells or a given cell e.g. A2.

So try this ( though I doubt if it speaks Scottish!) .

HTH


Anne CFS said:
Hi Toppers

Thanks for code. I've tried it and it runs beautifully, but doesn't check
the spelling. No spellcheck dialog box and no correction of a host of
Scottish words which are definitely not in the English dictionary, but which
eloquently express my frustration with this!!!

I should have mentioned - I'm using XL2000.

Cheers!
Anne

Toppers said:
Hi,

Try this which ignores cooments (XL2003):

wsActive.Select
If Range("B24").Value <> "" Then
If Application.CheckSpelling(Word:=Range("b24"), _
CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False) = False Then
MsgBox ("Check spelling of " & Range("B24"))
End If
End If


Anne CFS said:
I'm creating templates for users to use as reports - these have (among many
others) one merged cell which contains free text and of course the users
don't spell check.

I'm quite happy coding for spell checking before saving, but would prefer to
spellcheck only the relevant cell and I cannot get this to work. Code given
below:

Set wsActive = Worksheets("Current Status")
wsActive.Select
If Range("B24").Value <> "" Then
wsActive.Range("B24").CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
End If

This still checks the entire sheet, so I don't know what to do next. Also,
can I spellcheck only the value of this cell (Free entry text) without the
comment [which was added as short notes on the type of content required in
the cell].

Thanks in advance

Anne
 
A

Anne CFS

Hi there,

Tried your suggestion, but the spellcheck was still not functioning. After
a week or so away from it, I realised I ahdn't mentioned that the cell being
spellchecked is a merged cell. I unmerged it, tried your code and it worked
- beautifully.

so my code now looks like this:

If Range("B24").Value <> "" Then
If Application.CheckSpelling(Word:=Range("b24"), _
CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False) =
False Then
Range("b24:x28").UnMerge
Range("b24").CheckSpelling SpellLang:=2057
Range("B24:X28").Merge
End If
End If

It still spellchecks the comment, but as it's only 1 cell, I'm settling for
that.

Thanks again for all your help.

Toppers said:
Hi,

Cells.CheckSpelling SpellLang:=2057

Or

Range("a2").CheckSpelling SpellLang:=2057

Invokes Spellchecker and looks at all cells or a given cell e.g. A2.

So try this ( though I doubt if it speaks Scottish!) .

HTH


Anne CFS said:
Hi Toppers

Thanks for code. I've tried it and it runs beautifully, but doesn't check
the spelling. No spellcheck dialog box and no correction of a host of
Scottish words which are definitely not in the English dictionary, but which
eloquently express my frustration with this!!!

I should have mentioned - I'm using XL2000.

Cheers!
Anne

Toppers said:
Hi,

Try this which ignores cooments (XL2003):

wsActive.Select
If Range("B24").Value <> "" Then
If Application.CheckSpelling(Word:=Range("b24"), _
CustomDictionary:="CUSTOM.DIC", IgnoreUppercase:=False) = False Then
MsgBox ("Check spelling of " & Range("B24"))
End If
End If


:

I'm creating templates for users to use as reports - these have (among many
others) one merged cell which contains free text and of course the users
don't spell check.

I'm quite happy coding for spell checking before saving, but would prefer to
spellcheck only the relevant cell and I cannot get this to work. Code given
below:

Set wsActive = Worksheets("Current Status")
wsActive.Select
If Range("B24").Value <> "" Then
wsActive.Range("B24").CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
End If

This still checks the entire sheet, so I don't know what to do next. Also,
can I spellcheck only the value of this cell (Free entry text) without the
comment [which was added as short notes on the type of content required in
the cell].

Thanks in advance

Anne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top