#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default Array Help

can I creat a public array, the contents of which are visinle to all
procuedures in the project? How do I do this?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Array Help

Declare the array as Public right below the Option Explicit inside a
module.


Sandy wrote:
can I creat a public array, the contents of which are visinle to all
procuedures in the project? How do I do this?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Array Help

Declare the array as Public right below the Option Explicit inside a
module. For example:

Option Explicit

Public arrTest()

Public Sub SomeSub...

End Sub...

etc...


Sandy wrote:
can I creat a public array, the contents of which are visinle to all
procuedures in the project? How do I do this?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Array Help

at the top of the module

Public vArr(1 to 10) as Long

then if necessary initialize it in one of your procedures

Sub IntivArr()
for i = lbound(varr) to ubound(varr)
varr(i) = int(rnd*100+1)
Next
End sub

You will need to call InitvArr at least once before you try to extract any
values from the array (if that is what you need to do).

--
Regards,
Tom Ogilvy

"Sandy" wrote:

can I creat a public array, the contents of which are visinle to all
procuedures in the project? How do I do this?

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex conditional summing - array COUNT works, array SUM gives#VALUE fatcatfan Excel Worksheet Functions 4 November 18th 09 06:41 PM
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM


All times are GMT +1. The time now is 08:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"