It sounds like the error is only occurring in certain sheets, even though the same function is present across multiple ones. That usually points to something in the specific sheet context rather than the function itself. A few things you might want to check.