Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Excell, Global array/matrix

Status
Not open for further replies.

gustaf111

Programmer
Jan 16, 2011
87
0
0
SE
How do I declare and use a global array/matrix ?
 


hi,

Module level declaration...
Code:
Public YourArrayVar()

Sub SomeProcedure()
'.....
   ReDim Preserve YourArrayVar([i]...some dimensions ...[/i])
'.....
End Sub

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Can I have an global array in a sheet ? Do I need Redim ? It worked for me without ...
 


The Public declaration in a Sheet module has only that sheet in scope. However a public declaration in a Module has global scope.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top