When you dim an array, they are all numeric or string or variant without making a type.
Okay, not sure why you want to store the number when it would be the same that you'd use to call the letter(s) up with, but the example populates a table as follows:
1-26 in the first dimension is the alphabet positions
0-2 of second dimension tells what data is stored for that 'row' of the 'table'
value of 0 for the second dimension stores that number (1,2,3, etc...)
value of 1 for the second dimension stores the lower case value for that number (a,b,c, etc...)
value of 2 for the second dimension stores the upper case value for that number (A,B,C, etc...)
Code after populating table shows 2nd dimension values of the 12th 'row':
-----------------------------------------------------------------------
Dim aLetterTable(26, 2) As Variant, iCnt As Integer
For iCnt = 1 To 26
aLetterTable(iCnt, 0) = iCnt '1 for a, A; 2 for b, B; ...26 for z, Z
aLetterTable(iCnt, 1) = Chr(iCnt + 96) '97 is start of lower case letters (a).
aLetterTable(iCnt, 2) = Chr(iCnt + 64) '65 is start of capital letters (A).
Next
MsgBox "Letter " & aLetterTable(12, 0) & " is:" & vbCrLf & vbCrLf _
& "Lower Case: " & aLetterTable(12, 1) & vbCrLf _
& "Upper Case: " & aLetterTable(12, 2)
-----------------------------------------------------------------------
Arrays can be very complex the more dimensions you add. You could, for instance, have a third dimension which could depict font/character set/whatever.
Not sure why you're taking up space making an array storing 1 for a and 2 for b considering array(1) is a and array(2) is b (etc.) but hopefully this gives you the insight you need for whatever project you need it for.
|