View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Fred[_17_] Fred[_17_] is offline
external usenet poster
 
Posts: 20
Default How to keep an Array 'alive'

Rob,

thanks for the quick reaction ! But....
I declared it public in the main module which starts (load/show) the form on
which the array is filled. At the end of code execution of the Sub on the
form the Array is alive and filled with the correct values, but when the Sub
ends (the form is still active) the values disappear...


???

"Rob van Gelder" wrote in message
...
You could make it a public variable within a Standard Module

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Fred" wrote in message
...
Hi there,

I have a Sub in a form, which runs when a commandbutton is pressed. In

the
Sub an array is dimmed and filled with values.

e.g. Dim NANames(1 To 20, 0 To 2)

I need the values of the Array in another Sub, but the array is only
available in the specific Sub when created. Declaring it Public is not
possible with an array, so I need another way of doing this.

Anyone ?

Thanks !