ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array Help (https://www.excelbanter.com/excel-programming/370694-array-help.html)

Sandy

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

[email protected]

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



[email protected]

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



Tom Ogilvy

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



All times are GMT +1. The time now is 04:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com