vb如何給二維數(shù)組賦值 vb二維數(shù)組轉化為一維數(shù)組?
vb二維數(shù)組轉化為一維數(shù)組?Dim I as integer,j as integer假設有一個二維數(shù)組a(2,3)const r as integer=2const C as integer=3Di
vb二維數(shù)組轉化為一維數(shù)組?
Dim I as integer,j as integer
假設有一個二維數(shù)組a(2,3)
const r as integer=2
const C as integer=3
Dim b((2,1)*(3,1)-1)“定義一個新的一維數(shù)組
對于I=0到r
對于j=0到C
b(I*(3,1)j)=a(I,J) “將二維數(shù)組的所有元素賦給一維數(shù)組
下一個J
下一個I
對于I=0到(b)
打印b(I)”打印一維數(shù)組
下一個
VBA二維數(shù)組如何轉一維數(shù)組?一維如何轉二維?
一維到二維。
Msgbox Arr1(2,1)“轉換后的數(shù)組是一個具有一列和多行的二維數(shù)組,end sub 2。二維數(shù)組轉換為一維數(shù)組。
arr3=應用程序.轉置( 應用程序索引(arr2,2))“獲取arr2的第二列數(shù)據(jù)并將其轉置到一維數(shù)組msgbox arr3(2,)