Code to run a Spell check
-
- SilverLounger
- Posts: 1868
- Joined: 25 Jan 2010, 14:00
- Location: Conroe, Texas
Code to run a Spell check
What might be the code to run a spell check on the open sheet
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
Re: Code to run a Spell check
Try:ABabeNChrist wrote:What might be the code to run a spell check on the open sheet
Code: Select all
Cells.Select
Selection.CheckSpelling SpellLang:=1033
Regards
Don
Don
-
- Administrator
- Posts: 78475
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Code to run a Spell check
You can use
Cells.CheckSpelling
You can specify another language than the default one:
Cells.CheckSpelling SpellLang:=msoLanguageIDSpanish
Cells.CheckSpelling
You can specify another language than the default one:
Cells.CheckSpelling SpellLang:=msoLanguageIDSpanish
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78475
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Code to run a Spell check
There's no need to select the cells.Don Wells wrote:Try:Code: Select all
Cells.Select Selection.CheckSpelling SpellLang:=1033
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1868
- Joined: 25 Jan 2010, 14:00
- Location: Conroe, Texas
Re: Code to run a Spell check
Thank you Don and HansV
Thats a pretty small piece of code. lol
But it works good
Thats a pretty small piece of code. lol
Code: Select all
Cells.CheckSpelling
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
Re: Code to run a Spell check
I find that if cells are selected, when a spelling error is found, the cell in question is identified in the 'Name Box'. Otherwise on a large sheet the user is left to guess at the location and context.HansV wrote: There's no need to select the cells.
Regards
Don
Don
-
- Administrator
- Posts: 78475
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
Re: Code to run a Spell check
I'm still running 2003.HansV wrote:It doesn't work that way for me in Excel 2007...
Regards
Don
Don
-
- 2StarLounger
- Posts: 112
- Joined: 25 Jan 2010, 20:19
Re: Code to run a Spell check
I'm running 2003 as well and I do not see a cell reference in the Name Box if I do the spell check in code. I do get a cell reference if I run the spell checker manually.
-
- SilverLounger
- Posts: 1952
- Joined: 26 Jan 2010, 12:46
- Location: Nr. Heathrow Airport
Re: Code to run a Spell check (Excel 2003 SP3)
MorningABabeNChrist wrote:What might be the code to run a spell check on the open sheet
Out of interest I recorded a new macro and used the spell check on a work sheet into which a had typed a couple of dozens of lines of text and made sure some were spelt wrong, and I got this
Sub SpellIt()
'
' SpellIt Macro
' Macro recorded 28/02/2010 by Steve
'
' Keyboard Shortcut: Ctrl+k
'
Cells.CheckSpelling SpellLang:=2057
End Sub
When I tried it on some text that had again been spelt wrong it run exactly as the spell checker normally does with the dialog offering me alternatives. Like Don I too get = and a number and I guess that the difference is 1033 may be English US and 2057 may be English proper ( ). I am off to Google to see if I can find out.
Editted: Reason - to correct spelling mistake!!
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin
-
- Administrator
- Posts: 78475
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Code to run a Spell check
If you omit the SpellLang:=..., Excel will use the default language for spell checking.
Don Wells meant that the offending cell is selected, and hence its address (such as D3) displayed on the left of the formula bar when a spelling error is found. This doesn't happen if I run a spell check in code.
Don Wells meant that the offending cell is selected, and hence its address (such as D3) displayed on the left of the formula bar when a spelling error is found. This doesn't happen if I run a spell check in code.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
Re: Code to run a Spell check
I don't recall smoking anything unusual yesterday. Here is what happens when a spelling error is detected:HansV wrote:If you omit the SpellLang:=..., Excel will use the default language for spell checking.
Don Wells meant that the offending cell is selected, and hence its address (such as D3) displayed on the left of the formula bar when a spelling error is found. This doesn't happen if I run a spell check in code.
- The entire sheet is selected;
Cell 'A1' is active;
The Name Box identifies the cell which was active when the macro was run; and
The Spell Check dialog box is visible, identifying the spelling error.
My humblest apologies to all for any confusion.
Regards
Don
Don
-
- NewLounger
- Posts: 1
- Joined: 09 Jun 2022, 07:12
Re: Code to run a Spell check
Supported Tags: It supports all HTML elements.
Syntax :
Syntax for spellcheck attribute in an input field in html:
<input type="text" spellcheck="value">
Syntax for spellcheck in a textarea field in html:
<textarea type="text" spellcheck="value"></textarea>
<!DOCTYPE html>
<html>
<body>
<h3>Example of Disabling SpellCheck</h3>
<form>
<p>
<input type="text" spellcheck="false">
</p>
<p>
<textarea spellcheck="false"></textarea>
</p>
<button type="reset">Reset</button>
</form>
</body>
</html>
Syntax :
Syntax for spellcheck attribute in an input field in html:
<input type="text" spellcheck="value">
Syntax for spellcheck in a textarea field in html:
<textarea type="text" spellcheck="value"></textarea>
<!DOCTYPE html>
<html>
<body>
<h3>Example of Disabling SpellCheck</h3>
<form>
<p>
<input type="text" spellcheck="false">
</p>
<p>
<textarea spellcheck="false"></textarea>
</p>
<button type="reset">Reset</button>
</form>
</body>
</html>