HI shells, which may be formed by the activity of young and massive stars, or connected to energy released by interactions of high-velocity clouds with the galactic disk, may be partly responsible both for the destruction of CO clouds and for the creation of others. It is not known which effect prevails. We study the relation between HI shells and CO in the outer parts of the Milky Way, using HI and CO surveys and a catalogue of previously identified HI shells. For each individual location, the distance to the nearest HI shell is calculated and it is specified whether it lies in the interior of an HI shell, in its walls, or outside an HI shell. The method takes into account irregular shapes of HI shells. We find a lack of CO clouds in the interiors of HI shells and their increased occurrence in walls. Properties of clouds differ for different environments: interiors of HI shells, their walls, and unperturbed medium. CO clouds found in the interiors of HI shells are those that survived and were robbed of their more diffuse gas. Walls of HI shells have a high molecular content, indicative of an increased rate of CO formation. Comparing the CO fractions within HI shells and outside in the unperturbed medium, we conclude that HI shells are responsible for approx. 20 % increase in the total amount of CO in the outer Milky Way.