title: visual basic for application Excel
body: <p>I have written a code in module 1. I get the correct value for the output. But, When I call it in module 2, the output value is zero. I would be thankful, if anyone can help me.</p>
  
  <p>Module 1:</p>
  
  <pre><code>Sub MuAndVuCalculations() 
  BeamFlangeWidth = Sheets("MuVu").Range("D7") 
  BeamFlangeThickness = Sheets("MuVu").Range("D8") 
  BeamWebHeight = Sheets("MuVu").Range("D9") 
  M3 = (0.5 * BeamFlangeWidth * BeamWebHeight * BeamWebHeight ^ 2) 
  End Sub
  </code></pre>
  
  <p>module 2:</p>
  
  <pre><code>Sub Main() 
  Call MuAndVuCalculations 
  M = 5 Debug.Print M3 + M 
  End Sub 
  </code></pre>
  
  <p>In module 2 I can not see M3 in Immediate window and the output of the M3+5 is 5</p>