![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Philadelphia
Posts: 100
|
in VBA how do you reset all the values of a 2 dimensional array back to 0s, i know i could use 2 nested for statements but that takes to long and its a big array that needs to be cleared a lot. is there anyway to do it in one line of code? ive been trying stuff like
clear(MyArray()) i dont have any manuals so any help is appreciated, thanks. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Erase statement
Dim ArrayName(1 to 2, 1 to 2) to clear it Erase ArrayName Look up erase in help. Different types are treated differently with this statement. Tom |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
How about ReDim.
ReDim MyArray(1 To 5, 1 To 10) Change (1 To 5, 1 To 10) to your dimensions.
__________________
Kind regards, Al Chara |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|