Arrays

T

Torbjörn Steijer

Hi,

I have an array created in one procedure that I would like to use in another
procedure. How can I make the array in first procedure available in other
procedures?

TIA

Torbjorn
 
C

Chip Pearson

Torbjorn,

Declare the array as a public variable, prior to and outside of any
procedure in the module.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
O

onedaywhen

Or you could pass it as a variant argument e.g.

Sub Proc1()
Proc2 Array("Hello")
End Sub

Sub Proc2(ByVal ArgArray As Variant)
MsgBox ArgArray(0)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top