View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default Can I do this with a TextBox?


"Stuart" wrote in message
...

3 questions, please:

1. The textbox is positioned over the range "C26:L65". When the user

exits,
CheckSpelling runs on the textbox, then prompts to check the rest of

the
sheet. Can this be turned off?


Unfortunately, no. See below for another option.

2. When the user initially clicks within the textbox, the cursor is not
visible.
It's only after a second click that it appears. Can it appear the

first
time?


I hadn't realized that that was happening, but I confirmed that it does. I
tried various things to get it show, but couldn't come up with anything.

3. Can the tab key be enabled?


Inside the textbox? Control+tab can be used to tab inside the textbox.

As you've seen, there are some drawbacks to this spell check method. I
found a few more, like deselecting the textbox by selecting a protected cell
causes an error. That error can be trapped, I think, but it's a flaw in the
code that I gave you.

We're using the CheckSpelling method on a range object. You can also use
the CheckSpelling method of the Application object which will get rid of
some of those problems. However, it presents a whole new set of problems
and some additional coding. For instance, it only checks one word at a
time, so you have to split the text from the textbox into words and run the
method on those words. Doing this does not show the dialog with the
suggestions, it merely returns a True or False depending on the outcome of
the check.

Let me know if you want to investigate this alternative method.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com