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
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Spellcheck a single cell

On Sunday, June 9, 2013 2:49:04 AM UTC-7, Claus Busch wrote:
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


Thanks, Claus. I confused German(Standard) 1031 with English(US) 1033 and English(UK) 2057.

Works just fine now that I have my geography straightened out.

Thanks again.

Regards,
Howard
  #9   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 03:40:32 -0700 (PDT) schrieb Howard:

I confused German(Standard) 1031 with English(US) 1033 and English(UK) 2057.

Works just fine now that I have my geography straightened out.


if you get the suggestion window and you click "Ignore..." the spelling
will be accepted as correct. If you click "Cancel" you get incorrect.


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

On Sunday, June 9, 2013 3:46:34 AM UTC-7, Claus Busch wrote:
Hi Howard,



Am Sun, 9 Jun 2013 03:40:32 -0700 (PDT) schrieb Howard:



I confused German(Standard) 1031 with English(US) 1033 and English(UK) 2057.




Works just fine now that I have my geography straightened out.




if you get the suggestion window and you click "Ignore..." the spelling

will be accepted as correct. If you click "Cancel" you get incorrect.





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2


Claus,

On a test sheet your solution works just fine.

In the test cell (AK15) I enter the word "sceince", run the code and it offers suggestion just as I want. Pick suggestion = "science" OK Msgbox = "True" OK. All is fine.

On the actual (non test) worksheet with same code and same cell address, for some reason it insists on including the Caption of a Forms button that has
"C. Fmt." (a button that calls a conditional formatting macro.)

If I eliminate the button, all is good. I have moved the button around on the sheet to see if that made any difference, but the code finds it, if it exists. I tried a new button and entered the word "Doneky" and the code offered up "Donkey" as a suggestion. Accept Donkey and then it goes to AK15 where I have "Sceince" and does its job there. If Donkey is spelled correctly on the button then the code goes straight the AK15 cell and does its job there.

Sub SpellItAK()
Dim Ans As String
Ans = Range("AK15").CheckSpelling("CUSTOM.DIC", False, True, 1033)
MsgBox Ans
End Sub


I have other buttons on the sheet but they are spelled correctly and one has Ctrl-l on it but is not affected by the spell check code.
Any ideas?

Howard


  #11   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 04:35:14 -0700 (PDT) schrieb Howard:


On the actual (non test) worksheet with same code and same cell address, for some reason it insists on including the Caption of a Forms button that has
"C. Fmt." (a button that calls a conditional formatting macro.)

If I eliminate the button, all is good. I have moved the button around on the sheet to see if that made any difference, but the code finds it, if it exists. I tried a new button and entered the word "Doneky" and the code offered up "Donkey" as a suggestion. Accept Donkey and then it goes to AK15 where I have "Sceince" and does its job there. If Donkey is spelled correctly on the button then the code goes straight the AK15 cell and does its job there.


I tested it with ActiveX-Button and Forms Button, but the macro didn't
check the button. Even if the button calls the macro it don't check it.
I have no idea.


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

On Sunday, June 9, 2013 6:06:03 AM UTC-7, Claus Busch wrote:
Hi Howard,



Am Sun, 9 Jun 2013 04:35:14 -0700 (PDT) schrieb Howard:





On the actual (non test) worksheet with same code and same cell address, for some reason it insists on including the Caption of a Forms button that has


"C. Fmt." (a button that calls a conditional formatting macro.)




If I eliminate the button, all is good. I have moved the button around on the sheet to see if that made any difference, but the code finds it, if it exists. I tried a new button and entered the word "Doneky" and the code offered up "Donkey" as a suggestion. Accept Donkey and then it goes to AK15 where I have "Sceince" and does its job there. If Donkey is spelled correctly on the button then the code goes straight the AK15 cell and does its job there.




I tested it with ActiveX-Button and Forms Button, but the macro didn't

check the button. Even if the button calls the macro it don't check it.

I have no idea.





Regards

Claus Busch

--

Win XP PRof SP2 / Vista Ultimate SP2

Office 2003 SP2 /2007 Ultimate SP2


I thank you for giving it a look. Weird, but easy enough to work around.

Regards,
Howard
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 07:20 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"