Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Array Declaration


Hi

I'm trying to use an fixed array. Several macros will need to use thi
array and the contents of the array will be subject to continuou
changes.
Where and how do I declare the existence and size of this array?
Regards,
Mike
:

--
mikey1
-----------------------------------------------------------------------
mikey10's Profile: http://www.excelforum.com/member.php...fo&userid=1537
View this thread: http://www.excelforum.com/showthread.php?threadid=27020

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Array Declaration

If you write

Dim MyArray(1 to 30) As Variant

at the top of the module, outside of any procedures, it will be available to
all procedures in the module. Note that what I wrote is a fixed-sized or
static array. You can't change the size with a Redim statement. If you want to
do that, write it as

Dim MyArray() AS Variant

One of your procedures must, of course, use Redim to set the size.


On Mon, 18 Oct 2004 12:43:24 -0500, mikey10
wrote:


Hi

I'm trying to use an fixed array. Several macros will need to use this
array and the contents of the array will be subject to continuous
changes.
Where and how do I declare the existence and size of this array?
Regards,
Mike
:)


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Array Declaration

Several macros will need to use this array

Then you should declare it at the top of a standard module:

Dim MyArray(1 to 100, 1 to 2) as String

If some of the routines that will use the array are in other modules then
you have to declare the variable as Public:

Public MyArray(1 to 100, 1 to 2) as String

--
Jim Rech
Excel MVP
"mikey10" wrote in message
...
|
| Hi
|
| I'm trying to use an fixed array. Several macros will need to use this
| array and the contents of the array will be subject to continuous
| changes.
| Where and how do I declare the existence and size of this array?
| Regards,
| Mike
| :)
|
|
| --
| mikey10
| ------------------------------------------------------------------------
| mikey10's Profile:
http://www.excelforum.com/member.php...o&userid=15378
| View this thread: http://www.excelforum.com/showthread...hreadid=270204
|


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
Array Declaration. apis Excel Discussion (Misc queries) 1 November 5th 11 01:53 PM
dYNAMIC Array declaration, a small correction in my last thread! aiyer[_45_] Excel Programming 1 August 18th 04 01:13 AM
which declaration to use Peer Excel Programming 3 August 2nd 04 03:17 PM
Declaration? TJF[_2_] Excel Programming 5 December 18th 03 03:26 PM
Variable Declaration?? Tom Ogilvy Excel Programming 1 August 8th 03 06:45 PM


All times are GMT +1. The time now is 11:43 AM.

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"