After you spray your house to kill where they come in, you need to get fresh soil, and then get a hose, rinse ALL the dirt off the roots of your plants, rinse the plants with a mild diluted dish soap/ water combo, then repot.
You have to really wash it well, all dirt has to go, and you need to rinse the leaves where they meet the stem, ants like to hide there,
If you are repotting with soil you had sitting around, then the soil is probably infested too, so you will have to replace that.
I've also found if you get on of those plant dishes and rest the pots in the dish, and fill the dish with water, that the ants won't cross the barrier.