Sitting and spinning uses less energy than standing up and pushing larger gear, That does not mean you should not stand up at all. On a long climb, it is a not a bad idea every so often to shift up a gear or two and stand up foir a little bit, then sit down, shift back down, and resume your regular pace. This changes the muscles you are using a little bit and lets the one used when sitting to rest a bit.
This all assumes it is a "rhythm" climb, one on which you can fairly easily keep up a reasonable seated cadence for an extended period. On a steeper "power" climb, you do what ya gotta do to get - or what your legs and lungs can tolerate.
__________________
"I'm in shape -- round is a shape." Andy Rooney