PDA

View Full Version : [SOLVED:] Sharing variables between forms and modules



peacenik
07-07-2005, 06:00 PM
I have two variables, one an integer and one an array that I want to be available in both a module and a userform. I am struggling to find a way to easily do this. Is there a trick to this?

:dunno

johnske
07-07-2005, 06:29 PM
Hi peacenik,

Just declare them as Public at the top of the standard module. e.g.


Option Explicit

Public Numba as Long
'Your procedures here
' (ditto)

PS Long is preferred over Integer
HTH,
John

peacenik
07-07-2005, 06:52 PM
Thanks for the quick response. That worked beautifully.:friends: