Vancomycin is used to treat colitis (inflammation of the intestine caused by certain bacteria) that may occur after antibiotic treatment. Vancomycin is in a class of medications called glycopeptide antibiotics. It works by killling bacteria in the intestines.