reloading arrays

  • Thread starter Thread starter JJ
  • Start date Start date
J

JJ

I can load an array and then it to another sheet. What I
would like to do is clear the array and then re-load it
with different data and write it below the existing data
on another sheet.

How can I clear the array after writing it to the second
sheet?

Thanks
 
You can use the Erase statement to clear a static array.

Sub a()
Dim MyArray(0) As String
MyArray(0) = "abc"
MsgBox MyArray(0)
Erase MyArray
MsgBox MyArray(0)
End Sub


--
Jim Rech
Excel MVP
|I can load an array and then it to another sheet. What I
| would like to do is clear the array and then re-load it
| with different data and write it below the existing data
| on another sheet.
|
| How can I clear the array after writing it to the second
| sheet?
|
| Thanks
 
To the OP: Although the array "MyArray" has been "cleared" by the
procedure below, it remains declared as a String() type array.

Alan Beban
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top