ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setup Spell Checking on Userform textboxes (https://www.excelbanter.com/excel-programming/309852-setup-spell-checking-userform-textboxes.html)

Charles

Setup Spell Checking on Userform textboxes
 
Hi is it possible to have a button on a userform to enable
the user to check spelling in textboxes?.
TIA
Charles

K Dales

Setup Spell Checking on Userform textboxes
 
You can use Excel's built-in spell checking through VBA
with the CheckSpelling method. There is one catch: it
only checks a word at a time unless you use it on a range
or worksheet. So you have two choices: parse your textbox
into words and check each word (and design your own user
interface if errors found!) or put the textbox contents
temporarily into some cell on your worksheet and check
that cell. The code below accomplishes the 2nd method
(easier but not as elegant):

Private Sub CommandButton1_Click()


Range("TempCell") = Me.TextBox1
Range("TempCell").CheckSpelling
Me.TextBox1 = Range("TempCell")

Range("TempCell") = ""

End Sub

-----Original Message-----
Hi is it possible to have a button on a userform to

enable
the user to check spelling in textboxes?.
TIA
Charles
.



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com