title: Need to return value from a function in vba
body: <p>I am trying to return a value from a function but is not happening.</p>
  
  <pre><code>Public sub test()
    x = 2
    msgbox number(x)
  Exit Sub
  
  Public Function number(num)
    if len(num) = 1 then
       num = "0" + num
    End if
  End Function
  </code></pre>
  
  <p>The function is returning a null value.</p>