Test

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,030
Just testing various monospaced fonts (the test forum has HTML turned off; otherwise I'd use that).

Testing Calibri versus Verdana and various monospace fonts:

<hr /><h2>Calibri</h2><hr />
<font face=Calibri><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
<hr /><h2>Verdanda</h2><hr />
<font face=Verdana><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>

<hr /><h2>Courier New</h2><hr />
<font face="Courier New"><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
<hr /><h2>Lucida Sans Typewriter</h2><hr />
<font face="Lucida Sans Typewriter"><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
<hr /><h2>Consolas</h2><hr />
<font face=Consolas><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
<hr /><h2>Lucida Console</h2><hr />
<font face="Lucida Console"><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
<hr /><h2>Fake - using a made up font </h2><hr />
<font face=TotallyFake,Consolas,monospace><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>

<hr /><h2>Fake - using two made up font and default </h2><hr />
<font face=TotallyFake,ConsolasFake,monospace><SPAN style="color:#00007F">Private</SPAN> m_celTarget <SPAN style="color:#00007F">As</SPAN> Excel.Range<br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_KeyPress(<SPAN style="color:#00007F">ByVal</SPAN> KeyAscii As MSForms.ReturnInteger)<br><br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN><br>    <br>        <SPAN style="color:#00007F">If</SPAN> ActiveCell.Column > 7 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = ActiveCell<br>        <br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Range("A" & Rows.Count).End(xlUp)<br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = Cells(m_celTarget.Row, Columns.Count).End(xlToLeft)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> Len(m_celTarget.Value) <> 0 <SPAN style="color:#00007F">Then</SPAN> <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>        <br>        <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>            <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>        <br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br>    m_celTarget.Value = Chr(KeyAscii)<br>    <br>    TextBox1.Text = ""<br>        <br>    <SPAN style="color:#00007F">If</SPAN> m_celTarget.Column = 7 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(1, -6)<br>    <SPAN style="color:#00007F">Else</SPAN><br>        <SPAN style="color:#00007F">Set</SPAN> m_celTarget = m_celTarget.Offset(, 1)<br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br>    <br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br><br><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> TextBox1_LostFocus()<br><br>    TextBox1.Text = ""<br>    <SPAN style="color:#00007F">Set</SPAN> m_celTarget = <SPAN style="color:#00007F">Nothing</SPAN><br><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,577
Members
452,652
Latest member
eduedu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top