Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Spellcheck a single cell

I googled this and seems like it should check AK15, which it does, but if spelling is correct it moves on to other items on the sheet. And of all things the next "item" it checks for spelling is the text on a forms button "C. Fmt."
(Fmt not in Dict... suggest FM)

The Msgbox and Exit Sub are my idea of what I would like the code to do.
If spelling in AK15 is correct, tell me and when I click OK it goes away.

Thanks,
Howard

Sub SpellIt()
With Range("AK15")
Call .CheckSpelling("CUSTOM.DIC", False, True, 2057)
'Msgbox "Spelling is correct"
' Exit Sub
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Spellcheck a single cell

Hi Howard,

Am Sat, 8 Jun 2013 23:28:39 -0700 (PDT) schrieb Howard:

Sub SpellIt()
With Range("AK15")
Call .CheckSpelling("CUSTOM.DIC", False, True, 2057)
'Msgbox "Spelling is correct"
' Exit Sub
End With
End Sub


try:
Sub SpellIt()
Dim Ans As String
Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 2057)
MsgBox Ans
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Spellcheck a single cell

Hi Howard,

Am Sun, 9 Jun 2013 10:33:04 +0200 schrieb Claus Busch:

Sub SpellIt()
Dim Ans As String
Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 2057)
MsgBox Ans
End Sub


Ans is boolean and not string:

Sub SpellIt()
Dim Ans As Boolean
Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 1031)
If Ans = True Then
MsgBox "Spelling correct"
Else
MsgBox "Spelling incorrect"
End If
End Sub

or:
Sub SpellIt2()
Dim Ans As Boolean
Ans = Application.CheckSpelling(Range("AK34").Text, _
"CUSTOM.DIC", False)
If Ans = True Then
MsgBox "Spelling correct"
Else
MsgBox "Spelling incorrect"
End If
End Sub


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Spellcheck a single cell

Hi again,

Am Sun, 9 Jun 2013 11:00:17 +0200 schrieb Claus Busch:

Sub SpellIt2()
Dim Ans As Boolean
Ans = Application.CheckSpelling(Range("AK34").Text, _
"CUSTOM.DIC", False)
If Ans = True Then
MsgBox "Spelling correct"
Else
MsgBox "Spelling incorrect"
End If
End Sub


with Application.CheckSpelling you will get not suggestions from
CUSTOM.DIC


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Spellcheck a single cell

Thanks, Claus.

I like the way the first one works, with the suggestion box, with English(UK).
However, if I use this for English(US), it only returns Msgbox True regardless of correct or incorrect spelling.

Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 1031)

Sub SpellIt()
Dim Ans As String
Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 2057)
'Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 1031)
MsgBox Ans
End Sub

Howard



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Spellcheck a single cell

Hi Howard,

Am Sun, 9 Jun 2013 02:36:11 -0700 (PDT) schrieb Howard:

I like the way the first one works, with the suggestion box, with English(UK).
However, if I use this for English(US), it only returns Msgbox True regardless of correct or incorrect spelling.


sorry, I didn't change the language after testing. 1031 is German


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Spellcheck a single cell

Hi Howard,

Am Sun, 9 Jun 2013 02:36:11 -0700 (PDT) schrieb Howard:

Sub SpellIt()
Dim Ans As String
Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 2057)
'Ans = Range("AK34").CheckSpelling("CUSTOM.DIC", False, True, 1031)
MsgBox Ans
End Sub


if you check by "CUSTOM.DIC" you have to use the language of CUSTOM.DIC.
If you want to check for another language (e.g. German) try:
Range("AK34").CheckSpelling SpellLang:=1031


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
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
consolidate data (i.e. a single cell) from multiple spreadsheets intoa single sheet James Sheriff Excel Programming 4 August 4th 10 05:35 PM
Spellcheck plus Locking jfitzpat Excel Discussion (Misc queries) 3 August 8th 07 11:33 PM
From single cell variables to a single column serie noyau New Users to Excel 1 December 22nd 06 06:43 AM
Spellcheck zt Excel Discussion (Misc queries) 3 July 8th 05 09:33 AM
Spellcheck via VBA in excel? Random Excel Programming 1 September 4th 03 01:34 PM


All times are GMT +1. The time now is 04:24 PM.

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

About Us

"It's about Microsoft Excel"