A subscript out of range error occurs when the sheet name in the code does not match the sheet name in your file.

Check that the sheet names match.