vba courses london - how do you do

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

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?

resolvedResolved · Low Priority · Version 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:

Use GoTo to Select A Cell With VBA

To select a certain cell on a Worksheet you can use:

Application.Goto Reference:=Range("V300")

or more simply

Range("V300").Select

If, on the other hand, you want the selected cell to be the top/left cell on the screen you use:

Application.Goto Reference:=Range("V300"), Scroll=True

View all VBA hints and tips


Server loaded in 0.07 secs.