Error 9 is a "Subscript out of range" error which means that you have tried to reference either an array element in an empty array or an element index that is greater than the Ubound limit of the array.
You need to put some error trapping into your code.

All the best,

Dave.