title: How to return from a function in case of error in VBA
body: <p>I am new to VBA and want to return from a function when I see an error. Not able to do so. Any pointers?</p>
  
  <pre><code>Function GetEditboxValue(control As IRibbonControl, text As String) As String
  
      If Not IsMissing(text) Then
          If Not IsNumeric(text) Then
              MsgBox "Please enter numeric value only."
              ' I WANT TO RETURN HERE 
          End If
      End If
  
  
      If control.id = "xyz" Then
      spaceAboveTable = text
      End If
  
  
  End Function
  </code></pre>