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

I have an Array that defined as Public variable.
In procedure1, I Redim this variable and input data.
I procedure2, I try to Redim once more in order to input more data in the
same array.
Is there any way to do this, or will it be impossible to Redim an Public
Array after the initial definition?
Ideas, tricks?

I use procedure below.

Public Arrayname() as String' () in order to define dynamic Array

Sub Procedure1
Redim ArrayName(1 to 10, 3)
' Then I input data into this array
End Sub

Sub Procedure2
Redim Preserve Arrayname(1 to 20,3)
'Input data
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Redim Public Array variables

You can redim it all you want--but you can only change the size of the last
dimension.



Jarle wrote:

I have an Array that defined as Public variable.
In procedure1, I Redim this variable and input data.
I procedure2, I try to Redim once more in order to input more data in the
same array.
Is there any way to do this, or will it be impossible to Redim an Public
Array after the initial definition?
Ideas, tricks?

I use procedure below.

Public Arrayname() as String' () in order to define dynamic Array

Sub Procedure1
Redim ArrayName(1 to 10, 3)
' Then I input data into this array
End Sub

Sub Procedure2
Redim Preserve Arrayname(1 to 20,3)
'Input data
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Redim Public Array variables

To get that to work, modify the array:

Redim ArrayName(3, 1 to 10)

The last dimension is the one that can be preserved.

Then this will work:

Redim Preserve ArrayNames (3, 1 to 20)


"Jarle" wrote in message
...
I have an Array that defined as Public variable.
In procedure1, I Redim this variable and input data.
I procedure2, I try to Redim once more in order to input more data in the
same array.
Is there any way to do this, or will it be impossible to Redim an Public
Array after the initial definition?
Ideas, tricks?

I use procedure below.

Public Arrayname() as String' () in order to define dynamic Array

Sub Procedure1
Redim ArrayName(1 to 10, 3)
' Then I input data into this array
End Sub

Sub Procedure2
Redim Preserve Arrayname(1 to 20,3)
'Input data
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Redim Public Array variables

Jarle wrote:
I have an Array that defined as Public variable.
In procedure1, I Redim this variable and input data.
I procedure2, I try to Redim once more in order to input more data in the
same array.
Is there any way to do this, or will it be impossible to Redim an Public
Array after the initial definition?
Ideas, tricks?

I use procedure below.

Public Arrayname() as String' () in order to define dynamic Array

Sub Procedure1
Redim ArrayName(1 to 10, 3)
' Then I input data into this array
End Sub

Sub Procedure2
Redim Preserve Arrayname(1 to 20,3)
'Input data
End Sub

If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook

ResizeArray ArrayName,,20

Alan Beban
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
ReDim an array Nader Excel Programming 1 December 1st 06 04:41 AM
ReDim Array Brandt Excel Programming 1 October 9th 06 06:32 PM
ReDim Object array as parameter of Variant array Peter T Excel Programming 4 May 10th 05 02:11 PM
Dim / Redim of an Array Fred[_17_] Excel Programming 4 June 28th 04 03:16 PM
ReDim an Array Art[_5_] Excel Programming 3 October 25th 03 03:30 PM


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