简体   繁体   中英

Return an empty string array in a vba function

My code will not compile because of mismatch between return array and function return:

Function getRowFrom2DArray(Arr As Variant, RowNumber As Long) As String()
If NumberOfArrayDimensions(Arr) <> 2 Then
        getColumnFrom2DArray = Array()
        Exit Function
    End If

How can I force = Array() to be of type string, can I use the split function? split("","") or whats the best way?

很久以前,我就使用VBA,但据我所记得,您可以使用ReDim getRowFrom2DArray(0)初始化一个空数组。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM