This paper studies defect memory cells and in particular partially stuck-at memory cells, which occur when charge is trapped in multi-level cells of non-volatile memories such as flash memories. If a cell can store the q levels 0, 1, ... , q - 1, we say that it is partially stuck-at level s, where 1 ≤ s ≤ q - 1, if it can only store values which are at least s. We follow the common setup where the encoder knows the positions and levels of the partially stuck-at cells whereas the decoder does not. In this paper, we study codes for masking u partially stuck-at cells. We derive lower and upper bounds on the redundancy of such codes and present code constructions. Furthermore, we analyze the dual defect model in which cells cannot reach higher levels, and show that codes for partially stuck-at cells can be used to mask this type of defects as well. Lastly, we analyze the capacity of the partially stuck-at memory channel and study how far our constructions are from the capacity.