Talk about a Yo-Yo

I have been a member of myfitnesspal for more than few years now and since I began I have made it to my target weight, regained, made it to my target weight and gained it back again and we're not talking about 5-10 lbs, more like 40! I am definitely a stress eater and have had my share of stressful moments in my life, but I need to figure out how to be motivated by them not exhausted. Who else has this issue and are there ways to work through them that you've found have worked?