I made a user-defined function in vba that returns an array. It works fine in normal spreadsheets but failed when it is applied to a named table with error "#SPILL!" appears in the first cell. I'm sure there is no other content in the spill range. If I turn the normal spreadsheet range that the UDF works fine into a table structure the function became failed too with the "#SPILL!" error. I'm using Excel 365.
Here is a simple UDF to try (attached):
Public Function AAA(x as Integer) as Variant
Dim z(0 to 1) as Integer
z(0)=x +1
z(1)=x +2
AAA=z
End Function
Thanks for any advice.
chx77
Here is a simple UDF to try (attached):
Public Function AAA(x as Integer) as Variant
Dim z(0 to 1) as Integer
z(0)=x +1
z(1)=x +2
AAA=z
End Function
Thanks for any advice.
chx77