• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

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
0
AXISHK
Asked:
AXISHK
2 Solutions
 
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.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now