View Single Post
  #2   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

In a standard module

Public bSelectTB As Boolean

Sub SelectTb()

bSelectTB = True
Sheet1.Shapes("Text Box 1").Select

End Sub

Assing SelectTb to the textbox and change this code to reflect the correct
sheet and textbox name. Then, in the sheet's module

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If bSelectTB Then
Me.Shapes("Text Box 1").TopLeftCell.CheckSpelling
bSelectTB = False
End If

End Sub

Again change the textbox's name. This worked for me with limited testing,
but let me know if you have any problems.

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

"Stuart" wrote in message
...
User opens a book, containing a single sheet. Code in the
Workbook_Open Event runs and if certain conditions are
met then a TextBox created by the Drawing toolbar is
displayed and enabled for data entry.

User enters their data, and when they click a cell outside
the textbox (ie exit the textbox) CheckSpelling will
automatically run on just the textbox.

Having done so, user would be free to re-enter the
textbox, but again, CheckSpelling would run when they
exit.

An ActiveX textbox is fine, except that it doesn't offer the
bells and whistles features of Spell Checking.

Hope this makes sense.

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.727 / Virus Database: 482 - Release Date: 26/07/2004