Selectively addressing individual qubits in an array of ions is a vital task for scalable quantum computation with trapped ions. Traditionally, this is accomplished using complex optics for laser beam steering, but such schemes are not easily scalable. We have realized a scalable alternative which employs the advantages of microfabrication and cryogenic operation, and applies a magnetic field gradient to a chain of ions. The field is generated by a coil embedded within the trap structure, and self-aligned through simultaneous fabrication with trap electrodes. Measurements show that crosstalk between ions is below 3%: