It is well known that neutrophils take much longer to traverse the pulmonary capillary bed than erythrocytes, and this is likely due to differences in the structure and rheology of the cells. In this study, we simulate the transit of a neutrophil in a capillary using a Newtonian drop model and a viscoelastic drop model. The cell membrane is represented by an interface with isotropic and constant tension, and the cell motion and deformation are described by a phase-field method. The governing equations are solved using finite elements in an axisymmetric geometry, and the thin interfaces are resolved by mesh adaptivity. With a fixed pressure drop, the entry of a cell into a capillary consists of several stages in which the flow rate varies in distinct manners. The entrance time is consistent with experimental measurements. It decreases with the pressure drop, increases with the cell viscosity and generally decreases with the relaxation time of a viscoelastic cytoplasm. The capillary geometry has a strong effect on the entry and transit of a neutrophil. The entrance time increases sharply when the capillary diameter decreases or when the capillary is constricted by a pinch.