Vectors
One dimensional arrays
A single column matrix is called a column vector
A single row matrix is called a row vector
Row and Column Vectors
Dim aMyArray As Variant
aMyArray = Range("A1:B1") 'row vector
aMyArray(1,1) = 1
aMyArray(1,2) = 2
Dim aMyArray As Variant
aMyArray = Range("A1:A2") 'column vector
aMyArray(1,1) = 1
aMyArray(2,1) = 2
Dim aMyArray(1 to 2) As Integer
aMyArray(0) = 1
aMyArray(1) = 1
aMyArray(2) = 1
This will create a row vector by default
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext