Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Declare Function ArrayPtr Lib "msvbvm60.dll" Alias "VarPtr" (TargetArray() As Any) As Long
Private Sub Form_Load()
Dim XXX(1, 2, 3, 4) As Byte
Dim lpArray As Long
Dim lDim As Long
小弟前日在EXCEL VBA發問一則
有關如何得知陣列維數。已承蒙HSIEH版主
大大解惑。同時也告知小弟另有閔大版主的API函數
功能也能得到相同結果。
小弟也發費多日但仍無法引用版主大大此例如何
改成EXCEL VBA的方式而能得到版主大大所設定的功能。
是否能請版主大大解惑呢?
下列VBA語法為HSIEH版主大大提供如下
Function checkarray(mArray As Variant)
Dim i%, n%
i = 1
On Error Resume Next
Do Until Err.Number = 9
n = LBound(mArray, i)
If Err.Number = 0 Then i = i + 1
Loop
checkarray = i - 1
End Function
謝謝版主大大。
小弟揣摩版主大大的範例,
並修改實際例子之後;
卻出現陣列形態不符。
盼版主大大能再指點迷津。
另小弟有一疑惑,如果小弟想多了解
API函數的應用領域,不知如何著手呢?
Sub aa()
Dim ar1, ar2, ar3
Dim mData()
Dim s%, s1%, n1%, n2%, m%
Dim mSht1 As Worksheet
Dim mSht2 As Worksheet
Dim ar As Variant
Dim lpArray As Long
Dim lDim As Long