#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Arrays

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Arrays

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

"Torbjörn Steijer" wrote in message
...
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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Arrays

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


"Chip Pearson" wrote in message ...
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

"Torbjörn Steijer" wrote in message
...
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


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
Arrays David Excel Discussion (Misc queries) 2 May 12th 09 10:16 PM
Arrays Brendan Vassallo Excel Discussion (Misc queries) 4 February 23rd 06 02:27 AM
Arrays Tobro88 Excel Discussion (Misc queries) 3 November 18th 05 11:28 PM
Arrays Dan Excel Worksheet Functions 3 September 15th 05 07:36 AM
ARRAYS Gary B[_3_] Excel Programming 8 July 14th 03 03:59 AM


All times are GMT +1. The time now is 11:59 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"