title: VBA "Compile Error: Label not defined"
body: <p>I have a VBA macro which gave me that error message.</p>
  
  <pre><code>Sub Function1()
      '   Give the user macro options based on how fast or slow the computer 
      '   is using advanced conditional compiling
      vuserChoice = MsgBox("This macro by default treats all numbers as decimals for maximum precision. If you are running this macro on an old computer, you may want to declare numbers as singles, to speed up the macro.")
      MsgBox ("Decimal: recommended for maximum precision. Also slower." &amp; vbNewLine &amp; "Long: not recommended. Rounds to nearest integer." &amp; vbNewLine &amp; "Single: not recommended. A lightweight double." &amp; vbNewLine &amp; "Integer: not recommended. Quick and low-precision.")
  
      If vuserChoice = "Decimal" Or "decimal" Then
          GoTo FunctionDecimal
      ElseIf vuserChoice = "Double" Or "double" Then
          GoTo FunctionDouble
      ElseIf vuserChoice = "Single" Or "single" Then
          GoTo FunctionSingle
      ElseIf vuserChoice = "Long" Or "long" Then
          GoTo FunctionLong
      Else
          GoTo FunctionNotValidVarType
      End If
  
      '   MEeff = measure of efflux due to crudely purified HDL in scintillation
      MsgBox "For additional information about this macro:" &amp; vbNewLine &amp; "1. Go to tab Developer" &amp; vbNewLine &amp; "2. Select Visual Basic or Macro." &amp; vbNewLine &amp; "See the comments or MsgBoxes (message boxes)."
  End Sub
  </code></pre>
  
  <p>The offending line is:</p>
  
  <pre><code>GoTo FunctionNotValidVarType
  </code></pre>
  
  <p>I have the function <code>FunctionNotValidVarType</code> below this code. I have it as: </p>
  
  <pre><code>Public Sub FunctionNotValidVarType()
      MsgBox "VarType " &amp; VarType &amp; " is not supported. Please check spelling."
  End Sub
  </code></pre>
  
  <p>What do I need to do to let the first function recognize <code>FunctionNotValidVarType</code>? Thanks.</p>