我想在VBA数组的末尾添加一个值。我怎样才能做到这一点?我无法在线找到一个简单的示例。这是一些伪代码,显示我想做的事。
Public Function toArray(range As range)
Dim arr() As Variant
For Each a In range.Cells
'how to add dynamically the value to end and increase the array?
arr(arr.count) = a.Value 'pseudo code
Next
toArray= Join(arr, ",")
End Function
arr = Range.Value
?