title: How to use the results of User Form in another macro?
body: <p>I have a userform, lets say when I click the button name in the userform it will request me to enter a name and it is always stored in </p>
  
  <pre><code>private sub button_click()
    name = inputbox("Please enter your name:")
  end sub
  </code></pre>
  
  <p>The thing I want is, when I start the macro first user form will appear then after user enters the necessary information, the variables values' will last until the end of the main macro.</p>
  
  <p>I am searching for last two days couldn't find a solution but who knows maybe I couldn't find it. Therefore, i am writing here. Thanks in advance!</p>
  
  <p>`
  another question related:</p>
  
  <p>lets say I have</p>
  
  <pre><code>    Public plant As Variant
  Public checking As Variant
  Public MeanCov1 As Variant
  Public MeanCov2 As Variant
  Public MeanCov3 As Variant
  Public WeekCov1 As Variant
  Public WeekCov2 As Variant
  Public WeekCov3 As Variant
  Public RolLow As Variant
  Public RolHigh As Variant
  Public ServiceLevel As Variant
  Public TrendMultiplier As Variant
  Public WeekCov11 As Variant
  Public WeekCov22 As Variant
  Public WeekCov33 As Variant
  
  Sub initialize()
  MeanCov1 = 0.3
  MeanCov2 = 0.5
  MeanCov3 = 0.7
  WeekCov1 = 18
  WeekCov2 = 13
  WeekCov3 = 8
  WeekCov11 = -14 + WeekCov1
  WeekCov22 = -14 + WeekCov2
  WeekCov33 = -14 + WeekCov3
  
  RolLow = 0.3
  RolHigh = 0.7
  
  TrendMultiplier = 4
  
  ROL_Analysis.Show
  Application.Run ("ROL_Analysis_Macro")
  
  End Sub
  </code></pre>
  
  <p>I can not initialize the public variables, for example in user form it says show variable values but when I click it is completely empty</p>
  
  <pre><code>Private Sub ROLparameter_Click()
  Line1: RolLow = InputBox("Please enter the lower bound percentage for ROL calculation between 0 and 100 (initially " &amp; RolLow &amp; "%):")
  
  If Not 0 &lt;= RolLow &lt;= 100 Then GoTo Line1
  
  Line2: RolHigh = InputBox("Please enter the upper bound percentage for ROL calculation between 0 and 100 (initially " &amp; RolHigh &amp; "%):")
  
  
  End Sub
  </code></pre>