I might be tempted to make my UDF output an array (which means selecting multiple cells and confirming with ctrl-shift-enter like other array formulas). Something like
Function myudf1(strinput as string) as variant
dim tempout(1 to 2) as variant
'code to convert string to decimal
tempout(1)=result
tempout(2)="message about result"
myudf1=tempout
end function.
Note that a 1D array like this will output to Excel as a horizontal array, so you would select a 1 row x 2 column block of cells to enter the formula. You can also use the INDEX() function to return one result or the other =INDEX(myudf1("ddd-mm-ss"),1) to return the result, for example.
It's not clear to me if udf1 is the outer function or the inner function when the functions are nested together. If the array udf above is always the outer function, then it should not need any further changes. If the array udf above may be the inner function, then the outer function needs to be able to handle the array input. This could be done directly in the outer udf's code. You could also use the INDEX() function to select the appropriate part of the inner udf's output to input to the outer udf. =UDF1(INDEX(UDF2("ddd-mm-ss"),1))
I'm pretty sure that isn't the only way to do this, but it is one possible approach. I am optimistic that, one way or another, you should be able to accomplish what you want.
Bookmarks