1) Declare shared variables at the top of the module, above all procedures (Subs) and functions.
If you use
Code: Select all
Dim dblProfit As Double
Code: Select all
Public dblProfit As Double
Code: Select all
Sub Test()
Dim dblProfit As Double
dblProfit = 37.11
Call DoubleProfit(dblProfit)
End Sub
Sub DoubleProfit(SomeValue As Double)
MsgBox 2 * SomeValue
End Sub