The effect of flow shear on the stability of rotating ideal magnetohydrodynamic equilibria is investigated. It is found that a large enough shear can sometimes completely stabilize the flute(k=0) modes. The most notable result is a theorem which provides for an analytical determination of the exact number of unstable modes. A weaker sufficient condition for stability is also derived.