In order to access the entries in the array 'Jan_Sales_Figures', you need to use two indices, refering to the day of the month and the team number. You would then declare the array as follows: Dim Jan_Sales_Figures(1 To 31, 1 To 5) As Currency You would need a 2-dimensional array, consisting of 5 sets of figures over 31 days. An array having two dimensions can be thought of as a grid of values.įor example, imagine that you want to store daily sales figures for the month of January, for 5 different teams. However, arrays can have multiple dimensions. The Visual Basic Arrays discussed above are one-dimensional, in that they refer to one list of Names. Multi-Dimensional Excel Visual Basic Arrays Cells(i, 1).Value = Team_Members(i) Next iĮven with just 20 names, the advantages of using an Array are clear, but imagine if you had 1,000 names to store! And imagine you wanted to store Surnames separately from Forenames! It would soon become almost impossible to handle this amount of data without the use of Arrays in your VBA code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |