Perhaps it would help if you explained, or even posted, the 'real' code?

I'm not even sure what sheet related processing you are referrring to.