• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 150
  • 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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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