?
Solved

Erase array content with VBA

Posted on 2015-02-03
3
Medium Priority
?
143 Views
Last Modified: 2015-02-03
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
Comment
Question by:AXISHK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 1000 total points
ID: 40587835
ReDim will erase it if you don't use a Preserve.
https://msdn.microsoft.com/en-us/library/w8k3cys2.aspx
0
 
LVL 81

Assisted Solution

by:zorvek (Kevin Jones)
zorvek (Kevin Jones) earned 1000 total points
ID: 40587850
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
 

Author Closing Comment

by:AXISHK
ID: 40587861
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question