My guess is that your code does not correctly reference worksheets and cells.
Take it line by line while executing.