Thread: array
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dr. Stephan Kassanke[_2_] Dr. Stephan Kassanke[_2_] is offline
external usenet poster
 
Posts: 1
Default array


"??????? ?.?." schrieb im Newsbeitrag
...
In one module, I have written 3 VBA functions.
In each VBA function I have 10 arrays as follow:
Dim Aarr() As Variant: Aarr = Array("a", "¸b", "c", "d")
Dim Barr() As Variant: Barr = Array("aa", "¸bb", "cc", "dd")
Etc.
The 10 arrays are exactly the same for the 3 functions and I repeat them
for
each function.
Is there away to write only once the arrays in the module in order to work
for the 3 VBA functions?


Declare the arrays on module level instead of declaring them for each
function, thus you will get public variables.

cheers,
Stephan