Solved

# redim

Posted on 2006-04-12
352 Views
Hi,

Please kindly assist how can we increment allocation of X coodinate?

i.e.

Dim Arr_O(0, 4) As Integer
ReDim Preserve Arr_O(increament by 1, no change)

ReDim Preserve Arr_O(UBound(?)+1, no change)

Thanks
0
Question by:RyanBank

LVL 26

Expert Comment

you cannot, you can only redim the last dimension of a dynamic array
0

LVL 142

Expert Comment

I agree with EDDYKT
0

Author Comment

EDDYKT,

would you happen to know how we can redim the last diremtion? using the last value.
0

Author Comment

Dim Arr_O(4, 0) As Integer
ReDim Preserve Arr_O( no change,increament by 1)

ReDim Preserve Arr_O(no change,UBound(?)+1)
0

LVL 142

Assisted Solution

ReDim Preserve Arr_O(lbound(arr_o,0) to ubound(arr_o,0), lbound(arr_o,1) to UBound(arr_o,1) + 1)
0

LVL 26

Accepted Solution

You can reverse your array looks like

ie

Dim Arr_O(0, 4) As Integer

to

Dim Arr_O

ReDim Arr_O(4, 0)

ReDim Preserve Arr_O(4, 2)
ReDim Preserve Arr_O(4, UBound(Arr_O, 2) + 1)

0

Author Comment

EDDYKT,

if we didn't know the last value of the last dimension, how can we pull it up?
0

Author Comment

ReDim Preserve Arr_O(4, Ubound(?) +1)   what will the ? be
0

LVL 142

Expert Comment

0

Author Comment

0

Author Comment

got it using EDDYKT's solution.
0

## Featured Post

### Suggested Solutions

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…