How to return array() in vba function to use it in cells Array formulas (matricial formula) : for split texte in multi cells

后端 未结 3 1353
故里飘歌
故里飘歌 2021-01-06 04:10

I\'m writing a function in VBA to use in excel formula, it\'s ok if my function return a single value:

=MYVALUE(A1)

Now I wrote another fu

3条回答
  •  Happy的楠姐
    2021-01-06 04:38

    the reason is that your vector actually is being displayed horizontally, if you create an array formula horizontally you will get your numbers. For you to have a vertical vector use the following:

    Function MYARRAY(x As Integer)
    
        MYARRAY = Application.WorksheetFunction.Transpose(Array(10, 20, 30))
    
    End Function
    

提交回复
热议问题