ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I resize a named array in Excel from a MxN array to a mxn . (https://www.excelbanter.com/excel-programming/311201-how-do-i-resize-named-array-excel-mxn-array-mxn.html)

CymonM

How do I resize a named array in Excel from a MxN array to a mxn .
 
How do I resize a named array in Excel from a M by N array to a m by n, where
m and n are variables?

Alan Beban[_2_]

How do I resize a named array in Excel from a MxN array to amxn .
 
CymonM wrote:

How do I resize a named array in Excel from a M by N array to a m by n, where
m and n are variables?

Huh?

Alan Beban

Gary Brown[_7_]

How do I resize a named array in Excel from a MxN array to a mxn .
 
Either...

Redim NamedArray(m,n)

or if you don't want to lose the cdurrent array contents
when reallocating use...

ReDim Preserve NamedArray(m,n)

HTH,
Gary Brown

-----Original Message-----
CymonM wrote:

How do I resize a named array in Excel from a M by N

array to a m by n, where
m and n are variables?

Huh?

Alan Beban
.


sebastienm

How do I resize a named array in Excel from a MxN array to a mxn .
 
Look at the ReDim statement in the online-help.
It can only be done with dynamic array:
Eg:
Dim v() as string, v1(2,2) as string
'V1 cannot be re-dimensioned
'For V:
Redim V(1 to 2, 1 to 2)
v(1,1)="hello"
Redim V(1 to 3, 1 to 3) 'above , v is re-dimensioned... v(1,1) is now
empty-string
v(1,1)="world"
Redim Preserve V(1 to 3, 1 to 5) ' By using Preserve you can
re-dimension the
' last dimension of the array without loosing its values, ie
here,
' v(1,1) is still "world"
' but you can only do that on the last dimension.

Regards,
Sebastien
"CymonM" wrote:

How do I resize a named array in Excel from a M by N array to a m by n, where
m and n are variables?


Alan Beban[_2_]

How do I resize a named array in Excel from a MxN array to amxn .
 
CymonM wrote:

How do I resize a named array in Excel from a M by N array to a m by n, where
m and n are variables?

Well, you've got a couple of partial answers.

What's the difference between your M by N array and the resized array
that is m by n? Is M by N different from m by n??? How is the M by N
array declared?

Alan Beban

RB Smissaert

How do I resize a named array in Excel from a MxN array to a mxn .
 
Alan,

Doesn't the OP just want your ArrayTranspose function?
Or the Excel worksheet function Transpose?

RBS



"Alan Beban" wrote in message
...
CymonM wrote:

How do I resize a named array in Excel from a M by N array to a m by n,
where m and n are variables?

Well, you've got a couple of partial answers.

What's the difference between your M by N array and the resized array that
is m by n? Is M by N different from m by n??? How is the M by N array
declared?

Alan Beban



Tom Ogilvy

How do I resize a named array in Excel from a MxN array to a mxn .
 
doesn't sound like it

M X N could be 5 x 6 while m x n could be 2 x 15 or 3 x 10 for example.

--
Regards,
Tom Oglvy

"RB Smissaert" wrote in message
...
Alan,

Doesn't the OP just want your ArrayTranspose function?
Or the Excel worksheet function Transpose?

RBS



"Alan Beban" wrote in message
...
CymonM wrote:

How do I resize a named array in Excel from a M by N array to a m by n,
where m and n are variables?

Well, you've got a couple of partial answers.

What's the difference between your M by N array and the resized array

that
is m by n? Is M by N different from m by n??? How is the M by N array
declared?

Alan Beban





Alan Beban[_2_]

How do I resize a named array in Excel from a MxN array to amxn .
 
Tom Ogilvy wrote:
doesn't sound like it

M X N could be 5 x 6 while m x n could be 2 x 15 or 3 x 10 for example.

Or 13 by 17. Once you posit that m is a different size number than M,
there's no reason to think M*N=m*n, unless one were supposed to think
that that was implicit in the use of the word "resize".

And if something like the Transpose were sought, one would think that
the request would be about "resizing" from M by N to N by M.

Hey, the OP seems to be happy with the less than complete answers, so if
he/she is happy I can be happy for him/her.

Alan Beban

Harlan Grove

How do I resize a named array in Excel from a MxN array to a mxn .
 
"Alan Beban" wrote...
Tom Ogilvy wrote:
doesn't sound like it

M X N could be 5 x 6 while m x n could be 2 x 15 or 3 x 10 for example.

Or 13 by 17. Once you posit that m is a different size number than M,
there's no reason to think M*N=m*n, unless one were supposed to think
that that was implicit in the use of the word "resize".

....

Depends on whether the OP is used to different programming languages. FWLIW,
in APL

A is 6 5 rho iota 30

creates a 6 by 5 array like {1,2,3,4,5;6,..,10;...;26,..,30}, and

B is 3 11 rho A

is well-defined as

{1,2,..,11;12,13,..,22;23,24,..,30,1,2,3}

It's all a matter of where one's coming from, which the OP should have
stated.




All times are GMT +1. The time now is 01:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com