I have been to Rome twice and Barcelona once, but for quite a long stay.
For me Barcelona wins hands down. The architecture, the people, the sea, the harbour, the tapas...
It's probably my favourite city!
Rome is of course impressive too, but as others have said, it is more so for the individual sights than any overall feel.