Solved

Redim Preserve - Basic Question

Posted on 2011-03-02
6
478 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

760 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

20 Experts available now in Live!

Get 1:1 Help Now