In Barcelona the ship normally docks very close to town. It's definitely walking distance. You can walk to Las Ramblas and have a great couple of hours there. If you're there overnight they have a night tour that is very good. For Rome the ship docks at Cavitavecchia, which is @ an hour drive from Rome and @ 30-45 minutes from the airport.