Reputation: 167
I am facing one small problem please help me.
sub vari()
dim b as integer
dim c as integer
b=6
c=8
end sub
now i want to use b and c in another function .
sub calculate()
dim a as integer
a = c+b
end sub
I am getting error here
Upvotes: 2
Views: 22856
Reputation: 46628
You want to use the proper scope for your variables. If you want for b and c to be accessible to both vari() and calculate() you need to declare them globally, like so:
Public b As Integer
Public c As Integer
sub vari()
....
Upvotes: 8