Subscript out of range error is always associated with the sheet name. Please check that the sheet names match with the code with regard to spelling and case.