If one began taking a medication during the week, and it must be taken for several days consecutively so that skipping the Shabbat dose will harm its effectiveness, he may continue taking the medicine on Shabbat. This is because some maintain that the rabbinic enactment does not apply to dosing that began before Shabbat (R. Shlomo Kluger). When dealing with mass-produced medicine, one may rely on this opinion even le-khatĥila, and one may take such medicine even when he is not in pain.
Similarly, a woman who is taking birth control pills or medication to help her maintain a pregnancy may continue taking this medication on Shabbat as well.
If one takes daily vitamin supplements or weight loss pills to improve his health, he may continue on Shabbat as well.
SA 328:37 rules that a healthy person may eat food that sick people eat to help them get better. According to this, a healthy person may take vitamins and diet pills on Shabbat. However, according to MA and MB ad loc. 120, a healthy person may not do this in order to improve his health. Igrot Moshe, OĤ 3:54 takes this stringent opinion into account for a weak person, but permits a healthy person to take vitamins prophylactically. This is also the opinion of R. Ovadia Yosef, Halikhot Olam vol. 4, Tetzaveh §41. Nevertheless, if a sick person wishes to be lenient, he may rely on Tzitz Eliezer (cited in the previous note), which rules leniently because people do not grind medicine themselves anymore. Certainly, then, one may be lenient if he takes the vitamins daily, as we explained above.