Thread: Erase Arrays
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Erase Arrays

I don't think there is any way to use a loop to erase your
arrays. You'll have to explicitly erase each one.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"adriant42 " wrote in
message ...
Hi:


I have 20 or so module-level arrays that I want to Erase after

each
calling. My current code follows:


Module A
-----------------------

Private Array1() as Integer, _
Array2() as Long, _
Array3() as Double, _
:
:
Array20() as Integer


Public Sub Sub1()
...Code
End Sub

Public Sub EraseArray()
Erase Array1
Erase Array2
:
:
Erase Array20
End Sub

-------------------------------

Module B
------------------------

Sub Sub2()
Dim i as Integer

For i = 1 to 3
Sub1
EraseArray
Next i

End Sub

-------------------------------------


I use EraseArray to make sure that the new run doesn't retain

any old
values. My question is there a way to reset my module-level

array
without actually typing all 20 or so arrays like what I did in

my Sub
EraseArray()



Regards,
Adrian T


---
Message posted from http://www.ExcelForum.com/