View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ALEX ALEX is offline
external usenet poster
 
Posts: 493
Default How to create module wide 'constant'?

Excel Helper

I am writing some code which consists of circa 10 different procedures
within a module.

I want to be able to refer to an array in each without having to declare it
in each module.

My array is:

ddRWS = Array(4,16,28,40,52,64,76,88,100)

I want to be able to refer to this in each procedure with statements like:

ddRWS(2)
For i = UBound(ddRWS) to UBound(ddRWS)

Can I declare this array once at the top of the module and then refer to it
during proecedures? I have already tried:

Public ddRWS as Variant
ddRWS = Array(4,16,28,40,52,64,76,88,100)

....this didn't work so i tried...

Public ddRWS as Variant
Const = Array(4,16,28,40,52,64,76,88,100)

How can I declare my array and the assocaited values once only at the module
level so that it can be referred to in subsequent procedures?

Regards


Alex