The codex was part of the estate Leonardo left to his pupil and companion Fracesco Melzi. It passed to the sculptor Guglielmo della Porta and then in 1690, to the painter Guiseppe Ghezzi.
The Codex Leicester (previously known as Codex Hammer) is a collection of largely scientific writings by Leonardo da Vinci. The codex is named after Thomas Coke, later created Earl of Leicester, who purchased it in 1717. Of Leonardo's 30 scientific journals, the Codex may be the most famous of all.

Then in 1994 it was sold at auction again, and was purchased by Bill Gates for 30 millions dollars.
Codex Hammer