I am going to have to disagree with the above, to some extent.
There are many instances where treating an entire tank with fish not all in eminent danger of dying is a good idea. I can list a number of instances where it is not only not a bad idea, but where it is needed and advisable. Ich right off the top of my head.
But what determines where to treat a fish isn't so much determined by the medication being used as it is with the diseases/problem being treated. If it is something contagious, you pretty much always have to treat the whole tank, and the sooner the better.
However, when this is not the case it is almost always cheaper, easier and most effective to treat a fish in a a hospital tank or container. It is also rarely a good idea to medicate until one is pretty sure of what the problem is.
Mardel's antibiotics fall into several categories (I use them or the generic version).
Maracyn is basically erythromycin- I buy whichever is cheapest at the time.
Maracyn Two is basically minocycline which is a broad spectrum form of tetracycline.
Maracyn Plus is a mix of Sulfadimidine and Trimethoprim but in an unusual formulation. The meds are in tiny "bio-spheres" which attach to a fish. They are time release and this med is particularly effective against external bacterial issues. It is popular with people who get in wild caught altums which is how I came to it.
Most meds that will harm inverts will say so on the directions. More often its is the anti-parasite meds that are an an issue- stuff with copper etc. Their labels normally warn about this.
I have used all 3 of the above meds and have them in my medication kit. I have used them in tanks with pest snails that I only wish such meds would harm, but they did not. How they might affect shrimp I can't say. And while some meds can harm bacteria in a newly set up tank, once the bacteria get established in their protective bio-film this tends to change. Just as it provides a measure of protection against chlorine, it can also do so for antibiotics. But one should always monitor ammonia levels in a tank being treated with antibiotics just to be on the safe side. Every tank is different, so there are no hard and fast guarantees.