excel vba中 数组怎么赋值?
Dim aa() as double
aa = NewDoubleArray(1732.55,1834.45,1936.36,2038.27,2140.19,2240.1,2344.02,2445.95,2547.88,2649.82, _ 2751.76,2853.71,2955.66,3057.62,3159.58,3261.55,3363.53,3465.5,3567.48,3669.46, _ 3771.43, 3873.41,3975.39,4077.37,4179.35,4281.33,4383.31)
一运行 就弹出 “不可以对数组赋值”
[解决办法]
明白了,
不能用Public a(30),改为Public a as Variant
a不能固定大小,并在Sub中给a赋值
例:
Public a As Variant
Sub test()
a=Array(......)
End Sub
明白了?