title: Passing variable from Userform to Module in VBA
body: <p>I'm trying to pass the value of the variable &quot;proveedor&quot; from userform to another module. But I don't get it works. When I run &quot;TEST Sub&quot; appears that the &quot;proveedor&quot; variable wasn't defined. Any suggestion?</p>
  <p><strong>In the UserForm</strong></p>
  <pre><code>Private Sub cmdAceptar_Click()
  
      If optProveedorA.Value = True Then
          proveedor = &quot;ProveedorA&quot;
      End If
  
      If optProveedorB.Value = True Then
          proveedor = &quot;ProveedorB&quot;
      End If
  
      If optProveedorC.Value = True Then
          proveedor = &quot;ProveedorC&quot;
      End If
      
  End Sub
  </code></pre>
  <p><strong>In the module</strong></p>
  <pre><code>Public proveedor As String
  
  Public Sub TEST()
      'Show userform
      frmProveedor.Show
      
      Debug.Print proveedor
      
  End Sub
  </code></pre>