title: How can I convert an Userform Textbox value which is a String into a Long in Excel Vba?
body: <p>Here I am trying to read a <code>Textbox.Value</code> which is a <code>String</code> into a <code>Variable</code> (i.e. <code>text_bval</code>) and converting that <code>String</code> into a <code>Long</code> using <code>CLng</code> function for my calculations. The <code>CLng</code> function is showing run time error like type mismatch. </p>
  
  <p>See my code below:</p>
  
  <pre><code>Dim text_bval As String  
  Dim text_long As Long  
  Dim per As Integer  
  text_bval = text_box.value  
  user_entry = CLng(text_bval)
  </code></pre>