I've marked it as inactive in sandbox and tried deploying it to live
but I get an error saying a class cannot be marked as inactive!
HELP
5 answers
Jane, you can't deactivate an Apex Class, you can deactivate an Apex Trigger. If you need to deactivate code (say to rename the API name of a custom field) you need to comment out the relevant code, make the change, then uncomment.
If you need to make the change in production you need to do it in a dev sandbox first, publish the commented out/deactivated versions make your changes, then re-publish the uncommented ones!
I also have a nifty trick for building code that can be automatically disabled using Hierarchical Custom Settings if you're interested.