A system for handling pipes between a pipe rack (16) and a derrick (1), which derrick (1) is arranged on a drilling deck (2), in connection with the production of petroleum products, comprising means (17, 9, 25) of carrying pipe lengths (29) between the rack (16) and the derrick (1), characterized in a unit (25) at the drilling deck (2) for temporary storage of at least two pipe lengths (29) in respective receiving chambers (26, 28), which receiving chambers (26, 28) can be moved to and from at least one receiving and/or hand-over position, in which position a pipe handling unit is arranged to hand over a pipe length to a receiving chamber (26-28) and/or retrieve a pipe length from a receiving chamber (26-28).