ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set an array to zero (https://www.excelbanter.com/excel-programming/430710-set-array-zero.html)

T.Mad

Set an array to zero
 

Hi all,
How can I set an array to zero without looping to every element? For example
in FORTRAN with a single assignment e.g. Array=0 you can do that. Is there a
similar way in vba?
Many thanks


RB Smissaert

Set an array to zero
 

Two ways and best to see the details in the help file:
Redim
Erase

RBS


"T.Mad" wrote in message
...
Hi all,
How can I set an array to zero without looping to every element? For
example
in FORTRAN with a single assignment e.g. Array=0 you can do that. Is there
a
similar way in vba?
Many thanks



Jacob Skaria

Set an array to zero
 
Dim NumArray(10) As Integer ' Integer array.
Erase NumArray ' Each element set to 0.

If this post helps click Yes
---------------
Jacob Skaria


"T.Mad" wrote:

Hi all,
How can I set an array to zero without looping to every element? For example
in FORTRAN with a single assignment e.g. Array=0 you can do that. Is there a
similar way in vba?
Many thanks



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

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