?
Solved

Redim Preserve - Basic Question

Posted on 2011-03-02
6
Medium Priority
?
533 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 76

Assisted Solution

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

Accepted Solution

by:
GrahamSkan earned 2000 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

649 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