Having trouble finding a way to work around this error "subscript out of range"
I think the error is happening because of the UBound(xx) value is 3 and the (n) value is 10. This function is part of a larger code that I am not very familiar with but hoping maybe there is a work around for this error.
macrotroubles.jpg