Thanks Viorel-1
The reason that I augmented the dimensions was to show what the problem is. If you check the code by running it, you will see that the unused row and column cells report correctly. The problem is that the first two rows and columns report a #VALUE error, while the others do not.
This proves that the problem is with the For loop that assigns values to the used cells.
The problem doesn't go away if you eliminate the unused rows and columns.
That's my point.
I could make the same point in a different way by restricting the dimensions, but my concern is that, if I exhibited the problem in this way, then attention would be focussed on the function return mechanism (because every entry in the returned range would show the same error). But the problem is not the return mechanism. The problem is that, regardless of the return implementation, the cells which have been changed by the For loop report a #VALUE error, but the others do not.
Cheers
A
Cheers
A