  We consider the discrete spectrum of the two-dimensional Hamiltonian
$H=H_0+V$, where $H_0$ is a Schr\"odinger operator with a non-constant magnetic
field $B$ that depends only on one of the spatial variables, and $V$ is an
electric potential that decays at infinity. We study the accumulation rate of
the eigenvalues of H in the gaps of its essential spectrum. First, under some
general conditions on $B$ and $V$, we introduce effective Hamiltonians that
govern the main asymptotic term of the eigenvalue counting function. Further,
we use the effective Hamiltonians to find the asymptotic behavior of the
eigenvalues in the case where the potential V is a power-like decaying function
and in the case where it is a compactly supported function, showing a
semiclassical behavior of the eigenvalues in the first case and a
non-semiclassical behavior in the second one. We also provide a criterion for
the finiteness of the number of eigenvalues in the gaps of the essential
spectrum of $H$
