I have written a function to return a vector of the same size as input vectors "YTM", "Spread", "DF", and scalar "RECOVERY". The function seems to work just fine when I debug it, and different values are assigned to the different cells of the output. However, when I use this function in a worksheet I only get the same value in every cell. What am I doing wrong?
here's the code:
Btw, never mind the actual calculations in the code - it is not finished... The point is that P is a vector of different values, and after ImpSurvProb = P, the function output take on these P values when I debug it in Visual Basic, but shows only the first value for all vector entries in the worksheet...
Bookmarks