After getting to know VBA quite well there is still one issue I am having, I can't seem to get my head around passing values between modules. I hope someone here might be able to aid me in a simple theoretical example that will help me and hopefully others.
Sub module1()
Dim x As Integer
'general code
'general code
'general code
x = Sheet1.Range("A1").Value
call module2
'continue code
End Sub
Sub module2()
Dim y As Integer
y = x + 10
End Sub
All I am after is for someone to point me in the right direction on how to pass variable x to the second module, and then return y back to module1 and continue with the new calculated value.
Many thanks in advance!
Ryan.
Bookmarks