<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Spellcheck a TextBox</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 12:03:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Salomé Magerstein</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-31947</link>
		<dc:creator>Salomé Magerstein</dc:creator>
		<pubDate>Sun, 20 Apr 2008 14:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-31947</guid>
		<description>&lt;p&gt;I have this solution : it also selects (highlight) as well as add color to the TextBoxes.&lt;/p&gt;
&lt;p&gt;Range(&quot;A_1?) &amp; Range(&quot;A_2?) refer to Linked Cells in TextBoxes&lt;/p&gt;
&lt;p&gt;Private Sub TextBox1_GotFocus()&lt;br&gt;
        TextBox1.BackColor = RGB(255, 255, 153)&lt;br&gt;
        With TextBox1&lt;br&gt;
        .SelStart = 0&lt;br&gt;
        .SelLength = Len(.Text)&lt;br&gt;
        End With&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox1_LostFocus()&lt;br&gt;
        TextBox1.BackColor = RGB(255, 255, 255)&lt;br&gt;
        With TextBox1&lt;br&gt;
        .SelStart = 1&lt;br&gt;
        End With&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox2_GotFocus()&lt;br&gt;
        TextBox2.BackColor = RGB(255, 255, 153)&lt;br&gt;
        With TextBox2&lt;br&gt;
        .SelStart = 0&lt;br&gt;
        .SelLength = Len(.Text)&lt;br&gt;
        End With&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox2_LostFocus()&lt;br&gt;
        TextBox2.BackColor = RGB(255, 255, 255)&lt;br&gt;
        With TextBox2&lt;br&gt;
        .SelStart = 1&lt;br&gt;
        End With&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)&lt;br&gt;
    If KeyCode = 9 Then&lt;br&gt;
        TextBox2.Activate&lt;br&gt;
        Exit Sub&lt;br&gt;
    End If&lt;br&gt;
    If KeyCode = 13 Then&lt;br&gt;
        Sheets(&quot;Sheet1?).Range(&quot;A_1?).CheckSpelling&lt;br&gt;
        Exit Sub&lt;br&gt;
    End If&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)&lt;br&gt;
    If KeyCode = 9 Then&lt;br&gt;
        Range(&quot;B2?).Activate&lt;br&gt;
        Exit Sub&lt;br&gt;
    End If&lt;br&gt;
    If KeyCode = 13 Then&lt;br&gt;
        Sheets(&quot;Sheet1?).Range(&quot;A_2?).CheckSpelling&lt;br&gt;
        Exit Sub&lt;br&gt;
    End If&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Should any user find this useful, please let me know.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I have this solution : it also selects (highlight) as well as add color to the TextBoxes.</p>
<p>Range(&#8220;A_1?) &amp; Range(&#8220;A_2?) refer to Linked Cells in TextBoxes</p>
<p>Private Sub TextBox1_GotFocus()<br />
        TextBox1.BackColor = RGB(255, 255, 153)<br />
        With TextBox1<br />
        .SelStart = 0<br />
        .SelLength = Len(.Text)<br />
        End With<br />
End Sub</p>
<p>Private Sub TextBox1_LostFocus()<br />
        TextBox1.BackColor = RGB(255, 255, 255)<br />
        With TextBox1<br />
        .SelStart = 1<br />
        End With<br />
End Sub</p>
<p>Private Sub TextBox2_GotFocus()<br />
        TextBox2.BackColor = RGB(255, 255, 153)<br />
        With TextBox2<br />
        .SelStart = 0<br />
        .SelLength = Len(.Text)<br />
        End With<br />
End Sub</p>
<p>Private Sub TextBox2_LostFocus()<br />
        TextBox2.BackColor = RGB(255, 255, 255)<br />
        With TextBox2<br />
        .SelStart = 1<br />
        End With<br />
End Sub</p>
<p>Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)<br />
    If KeyCode = 9 Then<br />
        TextBox2.Activate<br />
        Exit Sub<br />
    End If<br />
    If KeyCode = 13 Then<br />
        Sheets(&#8220;Sheet1?).Range(&#8220;A_1?).CheckSpelling<br />
        Exit Sub<br />
    End If<br />
End Sub</p>
<p>Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)<br />
    If KeyCode = 9 Then<br />
        Range(&#8220;B2?).Activate<br />
        Exit Sub<br />
    End If<br />
    If KeyCode = 13 Then<br />
        Sheets(&#8220;Sheet1?).Range(&#8220;A_2?).CheckSpelling<br />
        Exit Sub<br />
    End If<br />
End Sub</p>
<p>Should any user find this useful, please let me know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Miller</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-2082</link>
		<dc:creator>Andy Miller</dc:creator>
		<pubDate>Wed, 04 Aug 2004 15:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-2082</guid>
		<description>&lt;p&gt;&lt;i&gt;He also wants a macro to close a workbook that&#039;s been opened with macros disabled, then reopen it with them enabled. Any ideas?&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;This is interesting. I think I came up with something that might work by using the workbook&#039;s customproperties collection.&lt;/p&gt;
&lt;p&gt;As far as I know, there is no &lt;i&gt;real&lt;/i&gt; MacrosEnabled property, so I don&#039;t know of an easy way of checking to see if the workbook was opened with macros enabled. Therefore, I had to resort to custom properties. The bad side of that is that this bit of code would need to go into every single workbook that you may need to check:&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><i>He also wants a macro to close a workbook that&#8217;s been opened with macros disabled, then reopen it with them enabled. Any ideas?</i></p>
<p>This is interesting. I think I came up with something that might work by using the workbook&#8217;s customproperties collection.</p>
<p>As far as I know, there is no <i>real</i> MacrosEnabled property, so I don&#8217;t know of an easy way of checking to see if the workbook was opened with macros enabled. Therefore, I had to resort to custom properties. The bad side of that is that this bit of code would need to go into every single workbook that you may need to check:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-2081</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Wed, 04 Aug 2004 05:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-2081</guid>
		<description>&lt;p&gt;Andy -&lt;/p&gt;
&lt;p&gt;Dick&#039;s method (or your cleaned up version) is certainly a reasonable approach. My client needed something a bit fancier, so I built something fancier.&lt;/p&gt;
&lt;p&gt;He also wants a macro to close a workbook that&#039;s been opened with macros disabled, then reopen it with them enabled. Any ideas?&lt;/p&gt;
&lt;p&gt;- Jon&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Andy -</p>
<p>Dick&#8217;s method (or your cleaned up version) is certainly a reasonable approach. My client needed something a bit fancier, so I built something fancier.</p>
<p>He also wants a macro to close a workbook that&#8217;s been opened with macros disabled, then reopen it with them enabled. Any ideas?</p>
<p>- Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Miller</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-2080</link>
		<dc:creator>Andy Miller</dc:creator>
		<pubDate>Tue, 03 Aug 2004 14:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-2080</guid>
		<description>&lt;p&gt;Jon - that had been the only way that I knew of to do spell-checking (I&#039;ve never actually had a need for it myself).&lt;/p&gt;
&lt;p&gt;I kinda thought that Dick&#039;s method (once I cleaned it up a bit LOL) was pretty nice. Low overhead and not a lot in the way of code or complexity.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jon &#8211; that had been the only way that I knew of to do spell-checking (I&#8217;ve never actually had a need for it myself).</p>
<p>I kinda thought that Dick&#8217;s method (once I cleaned it up a bit LOL) was pretty nice. Low overhead and not a lot in the way of code or complexity.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-2079</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 03 Aug 2004 06:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-2079</guid>
		<description>&lt;p&gt;For a recent project, the client wanted spell checking of the textboxes in the userforms. I&#039;d found an incomplete how-to on the web which made use of Word&#039;s spell-checking capabilities. You actually open an instance of Word, but hide the window out of sight above the actual part of the desktop that the monitor sees (doesn&#039;t work if the window is not visible). You copy the textbox contents into the hidden window and spell check it. If there&#039;s a misspelled word, the familiar dialog pops up, otherwise, on to the next textbox.&lt;/p&gt;
&lt;p&gt;The original web page I&#039;d found (can&#039;t find it now, but this might be a more recent version: &lt;a href=&quot;http://msdn.microsoft.com/library/en-us/odc_wd2003_ta/html/odc_wdspellchkr.asp&quot; rel=&quot;nofollow&quot;&gt;http://msdn.microsoft.com/library/en-us/odc_wd2003_ta/html/odc_wdspellchkr.asp&lt;/a&gt;) left out some crucial bits, and I added more of my own. For instance, it&#039;s not easy for the user to know something&#039;s happening unless he gets the misspelling dialog. But I made the code select the contents of each textbox as a visible cue that it was working.&lt;/p&gt;
&lt;p&gt;I finished it at 3:30 one morning, and the client was impressed. It was rather slick, I must admit.&lt;/p&gt;
&lt;p&gt;- Jon&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>For a recent project, the client wanted spell checking of the textboxes in the userforms. I&#8217;d found an incomplete how-to on the web which made use of Word&#8217;s spell-checking capabilities. You actually open an instance of Word, but hide the window out of sight above the actual part of the desktop that the monitor sees (doesn&#8217;t work if the window is not visible). You copy the textbox contents into the hidden window and spell check it. If there&#8217;s a misspelled word, the familiar dialog pops up, otherwise, on to the next textbox.</p>
<p>The original web page I&#8217;d found (can&#8217;t find it now, but this might be a more recent version: <a href="http://msdn.microsoft.com/library/en-us/odc_wd2003_ta/html/odc_wdspellchkr.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/odc_wd2003_ta/html/odc_wdspellchkr.asp</a>) left out some crucial bits, and I added more of my own. For instance, it&#8217;s not easy for the user to know something&#8217;s happening unless he gets the misspelling dialog. But I made the code select the contents of each textbox as a visible cue that it was working.</p>
<p>I finished it at 3:30 one morning, and the client was impressed. It was rather slick, I must admit.</p>
<p>- Jon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Miller</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-2078</link>
		<dc:creator>Andy Miller</dc:creator>
		<pubDate>Mon, 02 Aug 2004 21:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-2078</guid>
		<description>&lt;p&gt;In any case, it looks like setting Application.DisplayAlerts = False will prevent the messagebox asking if you want to spellcheck the rest of the sheet. I see now that I set it to False twice, rather than setting it to True at the end, as I meant to do (copy &amp; paste can get one into trouble).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>In any case, it looks like setting Application.DisplayAlerts = False will prevent the messagebox asking if you want to spellcheck the rest of the sheet. I see now that I set it to False twice, rather than setting it to True at the end, as I meant to do (copy &amp; paste can get one into trouble).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-2077</link>
		<dc:creator>Dick</dc:creator>
		<pubDate>Mon, 02 Aug 2004 21:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-2077</guid>
		<description>&lt;p&gt;Andy:  Hmmm.  It seems I forgot to mention that SelectTb needs to be assigned to the textbox using Assign Macro.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Andy:  Hmmm.  It seems I forgot to mention that SelectTb needs to be assigned to the textbox using Assign Macro.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Miller</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/02/spellcheck-a-textbox/#comment-2076</link>
		<dc:creator>Andy Miller</dc:creator>
		<pubDate>Mon, 02 Aug 2004 20:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=704#comment-2076</guid>
		<description>&lt;p&gt;I didn&#039;t know what your SelectTB sub was doing (I mean, I see what it&#039;s doing, but not when it would be called). However, this little tidbit does the trick, I think:&lt;/p&gt;
&lt;p&gt;Private Sub Worksheet_SelectionChange(ByVal Target As Range)&lt;/p&gt;
&lt;p&gt;    If strTBText &lt;&gt; Me.Shapes(&quot;Text Box 1?).TextFrame.Characters.Caption Then&lt;br&gt;
        Application.DisplayAlerts = False&lt;br&gt;
        Me.Shapes(&quot;Text Box 1?).TopLeftCell.CheckSpelling&lt;br&gt;
        bTextSelect = False&lt;br&gt;
        Application.DisplayAlerts = False&lt;br&gt;
        strTBText = Me.Shapes(&quot;Text Box 1?).TextFrame.Characters.Caption&lt;br&gt;
    End If&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;I used strTBText as a Public variable, but I don&#039;t think that you would even need to. I think that the sheet could actually hold it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I didn&#8217;t know what your SelectTB sub was doing (I mean, I see what it&#8217;s doing, but not when it would be called). However, this little tidbit does the trick, I think:</p>
<p>Private Sub Worksheet_SelectionChange(ByVal Target As Range)</p>
<p>    If strTBText &lt;&gt; Me.Shapes(&#8220;Text Box 1?).TextFrame.Characters.Caption Then<br />
        Application.DisplayAlerts = False<br />
        Me.Shapes(&#8220;Text Box 1?).TopLeftCell.CheckSpelling<br />
        bTextSelect = False<br />
        Application.DisplayAlerts = False<br />
        strTBText = Me.Shapes(&#8220;Text Box 1?).TextFrame.Characters.Caption<br />
    End If</p>
<p>End Sub</p>
<p>I used strTBText as a Public variable, but I don&#8217;t think that you would even need to. I think that the sheet could actually hold it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

