ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ReDim Matrix (https://www.excelbanter.com/excel-programming/371086-redim-matrix.html)

Arne Hegefors

ReDim Matrix
 
Is it possible to ReDim a matrix? I am trying to do just that but I get the
error message that Matrix dimension already set. Please need help!

Jan Karel Pieterse

ReDim Matrix
 
Hi Arne,

Is it possible to ReDim a matrix? I am trying to do just that but I get the
error message that Matrix dimension already set. Please need help!


Yes, but to be able to do that you need to change your declaration to:

Dim MyMatrix() as Variant/Long/String/Double/.....

(i.e. omit the size info between the brackets).

Check Help on the ReDim statement. It reads somewhe

Remarks

The ReDim statement is used to size or resize a dynamic array that has already
been formally declared using a Private, Public, or Dim statement with empty
parentheses (without dimension subscripts).



Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com



All times are GMT +1. The time now is 10:59 AM.

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