Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I've the main sub needing receive a value (amount) from a subroutine.
How can I figure it out?
Thank's.
I've the main sub needing receive a value (amount) from a subroutine.
How can I figure it out?
Thank's.
VBA Code:
sub main()
...
...
call subroutine()
...
...
a = z + amount
...
...
end sub
sub subroutine()
...
...
Dim amount As Long
amount = Application.WorksheetFunction.Sum(tab.Range("G2:G" & counter))
...
...
end sub