Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba courses london - how do you do

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - How do you do an array?

vba courses london - How do you do an array?

ResolvedVersion Standard

Toby has attended:
Excel VBA Intro Intermediate course

How do you do an array?

How do you do an array?

RE: How do you do an array?

Hi Toby

To create an array in VBA, you need a statement such as:

Dim myArray(1 To 8) As Integer

This will create an array of Integers using the values provided in this case 1 to 8.

an alternate is
Dim myArray As Variant
myArray = Array(1, 2, 3, 84 5)

There are many other types of array, i.e. an array of strings that you should look into.

Hope this helps

David

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

VBA tip:

Suspend DisplayAlerts in VBA

To stop Excel asking you things like "Do you want to delete this file...", use the following line of code at the beginning of the relevant VBA procedure:

Application.DisplayAlerts = False

At the end of the procedure make sure you use the following code to reactivate Display Alerts:

Application.DisplayAlerts = True

View all VBA hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.