Solved

Redim Preserve - Basic Question

Posted on 2011-03-02
6
488 Views
Last Modified: 2012-05-11
I want to turn this array...

a(1) = "foo"
a(2) = "bar"

...into this array...

a(1,1) = "foo"
a(1,2) = "bar"

...using Redim Preserve.  I am sure it's possible.  But I can't work out the syntax.

0
Comment
Question by:shacho
  • 4
  • 2
6 Comments
 

Author Comment

by:shacho
ID: 35024395
Does this not work with lbound 1 arrays?
0
 

Author Comment

by:shacho
ID: 35024397
a.k.a. "base 1" arrays?
0
 

Author Comment

by:shacho
ID: 35024401
a(0,0) = "foo"
a(0,1) = "bar"

would also be fine.

Point is I want to figure out how to use Redim.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 500 total points
ID: 35024405
You cannot change the number of dimensions with a Redim
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 35024424
Mike,
To ecpand on that:

You would have to create a second array, Redim that with the wanted number of dimensions and fill it from the first.

Also, when you Redim a multi-dimensional array, you can only change the size of the last dimension,

0
 

Author Comment

by:shacho
ID: 35024448
Oh well.  Thanks for the comments.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now