It's an ill wind that blows no good

This is said when things have gone wrong; the idea being that when bad things happen, there can also be some positive results.