View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default private variable: same module, other Sub/Function

That was the problem, now it works.
Thanks,
Stefi


€˛Snake Plissken€¯ ezt Ć*rta:

I suggest to declare variables before subs as follows

option explicit

dim var1, var2 as string
dim var3, var5 as integer
dim var4 as long
etc.

sub name_of_sub_1 ()
var1= "anystring"
.......
end sub

sub name_of_sub_2()
var3= 5
var5= 6
......
end sub

Function name_of_f(...)
'here u can "read" value of variables from subs and perform a function
end function