Erase array content with VBA

I have defined a 2D array

Dim myArray (1 To 20, 1 To 3)

erase myArray

It seems that the content of the array can't be erased. I need to clear its content when the invoice number is changed. Any idea ?

Tks
AXISHKAsked:
Who is Participating?
 
Daniel WilsonCommented:
ReDim will erase it if you don't use a Preserve.
https://msdn.microsoft.com/en-us/library/w8k3cys2.aspx
0
 
zorvek (Kevin Jones)ConsultantCommented:
Why do you believe that Erase does not do what you desire?

Erase clears all elements of the array and sets them to Empty.

Kevin
0
 
AXISHKAuthor Commented:
Tks. There is a logical bug in my program and I haven't erase it when the program is rerun again, Tks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.