So the LORD blessed the latter end of Job more than his beginning... (Job 42.12)
I don't know who first coined the phrase "God never closes a door without opening a window," although that line always makes me think of The Sound of Music, but I came across a similar sentiment in the Divine Meditations and Holy Contemplations of Richard Sibbes, Works, Vol. 7, p. 200:
143. It is a true rule in divinity, that God never takes away any blessing from his people but he gives them a better. When Elijah was taken from Elisha into heaven, God doubled his Spirit upon Elisha. If God takes away wife or children, he gives better things for them. The disciples parted with Christ's bodily presence, but he sent them the Holy Ghost.