Stocarea de valori într-o matrice (Array)

Pentru a atribui o valoare unui element dintr-o matrice, trebuie identificat elementul folosind indexul elementului. De exemplu, instrucțiunea de mai jos atribuie valorile London, Hong Kong și Taipei pentru primele trei elemente din matricea numită strLocations:

Option Base 1
Dim strLocations(6) As String
strLocations(1) = "London" 
strLocations(2) = "Hong Kong 
strLocations(3) = "Taipei"