title: VBA Textbox remove last letter
body: <p>I have a program which converts decimal to binary and backwards while you're typing in the textbox. To do this, I have a check whenever the textbox changes to determine if the last character was a number (Using the Mid() function.)</p>
  
  <p>My question is, instead of making the program send and error message when the last character is for example a letter, if there is a way to remove the last character from the string.</p>
  
  <p>This is what I use to determine if the last character was a number:</p>
  
  <pre><code>LastChar = Mid(TextBox1.Text, Len(TextBox1.Text), 1)
  If IsNumeric(LastChar) Then
       'Do the convert stuff here
  Else
       TextBox2.Text = "ERROR: You must fill in a decimal number"
  End If
  </code></pre>
  
  <p>I have browsed a lot on the internet, but all the methods I found did not work in the VBA I have to use for school. (Such as Me!TextBox1.Undo)</p>
  
  <p>Thanks in advance.</p>