ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Q: Declaring a dynamic array (https://www.excelbanter.com/excel-programming/288216-q-declaring-dynamic-array.html)

Srdjan Kovacevic[_4_]

Q: Declaring a dynamic array
 
Can anyone explain how to declare an array of form:

Arr(X1, X2, ..., Xn)

Where n is user defined variable?

How would I read/write data from such an array?

Thanx in advance!

srdjan

Chip Pearson

Declaring a dynamic array
 
Srdjan,

Try something like the following:

Dim Arr() As Long
Dim N As Long
N = 10
Redim Arr(1 To N)




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



"Srdjan Kovacevic" wrote in
message ...
Can anyone explain how to declare an array of form:

Arr(X1, X2, ..., Xn)

Where n is user defined variable?

How would I read/write data from such an array?

Thanx in advance!

srdjan





All times are GMT +1. The time now is 05:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com