title: VBA in Excel - Userform Variable = textbox.text but only when textbox.text is not empty
body: <p>I am having an issue with ensuring that Variable = textbox.text but only when textbox.text is not empty</p>
  
  <p>I have a series of checkboxes on my userform each of them ties to a variable whose value is an integer based on labels caption. One of them needs to be tied to a textbox to allow for additional costs to be added to the total and needs to have an error to prompt user if the checkbox value is true but the textbox is empty, this I have done fine. The issue is that the variable for tied to the textbox text isnt working and my guess is that its linked to the error so i have to ensure the variable only = the textbox text if the textbox text is not empty.</p>
  
  <p>This is my code thus far</p>
  
  <pre><code>    If chkbOther.Value = True And txtOther.Text &lt; "" Then Other = CDbl(txtOther.Text)
          If chkbOther.Value = False Then Other = 0
      If chkbOther.Value = True And txtOther.Text = "" Then MsgBox "Please enter the additional service cost", vbCritical, "Missing Value Error"
  </code></pre>