Boil the macaroni according to package directions, drain and leave them to cool.
Put the sugar for the caramel in a casserole on the stove and leave it to caramelize.
Pour the prepared caramel in at the bottom of the tray in which you intend to bake, wait for it to cool and add the macaroni.
Beat the eggs with the sugar until creamy, add the heated milk and vanilla and pour the mixture over the macaroni.
Put it to bake at 356°F (180 °C) until thickened and until the liquid evaporates - about 40 min.