Using a common elevator in Shabbat is not permitted, because the activation of any electrical device is considered a melakha (a Biblical Shabbat prohibition) or at least a rabbinical prohibition (see this).
But what about taking an elevator that has been programmed to stop in every floor and it automatically opens and closes its doors? They are known in Hebrew as ma'alit Shabbat and in Israel, New York and other areas with a significant Jewish population, one can find these elevators in hotels, Hospitals or big apartment buildings. Are those elevators permitted on Shabbat?
Modern rabbis have analyzed and discussed this issue.
Some rabbis (Rabbi Vozner and others) have forbidden to use it because when a person takes the elevator it forces its engine to use more electricity causing thereby a (slight) increase in the consumption of energy.
Rabbi Halperin from Israel, a specialist in Halakha and modern world, holds that it is permitted to go up with an automatic elevator but not down. When going down, the elevator uses also the person's weight (slightly) as a source of energy.
Most contemporary Rabbis (Rabbi Auerbach, Rabbi Obadia Yosef and others) authorize using an automatic elevator on Shabbat, particularly for a Mitzva, like going or coming from Synagogue, attending Seudot Shabbat, etc. They considered that the arguments regarding the interaction between the person's weight and the elevator, in terms of the modification of energy consumption are indirect, incidental and non-deliberate side effects (pesiq resheh, see here) and therefore they do not need to be taken into account. They indicate, however, that when the doors of the elevator are closing, a person should not try to enter into the elevator, because that would cause the doors to be open as a direct result of the person's action.
Shabbat Shalom and Chodesh Tob!
Candle lighting in NYC: 7:32 p.m.
Shabbat ends in NYC: 8:38 p.m.
Priceless!
A New York Times article on Shabbat Elevators