title: Using a variable's value from one sub into another in VBA
body: <p>Please, I am trying to use a variable's value from one sub into another, but unfortunately I did not get it. Follow the code below:</p>
  
  <pre><code>Sub get_value()
      Dim area2 As Range
  
      Set area2 = Range(Cells(8, 2), Cells(linha, 2))
      f = area2.Count
      s = x - f
  End Sub
  
  Sub get_value_s()
      Worksheets(2).Activate
  
      Range("A3").Select
      Selection.End(xlDown).Select
      linha = Selection.Row
      linha2 = linha + s
  
      Rows(linha2).Select
      Selection.Insert Shift:=xlDown
  End Sub
  </code></pre>
  
  <p>P.S. I have set s as integer globally. (Public s As Integer). </p>
  
  <p>Many thanks!</p>