Solved

Redim Preserve - Basic Question

Posted on 2011-03-02
6
516 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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…

726 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