There are 3 airports "in" Barcelona. Two are infact outside the city and take about an hour to get to.
Reus-about 106km
Girona-about 103km from Barcelona
El Prat-about 18 km from Barcelona
El prat is definitely a muchmore pleasurable travelling experience but often you can only fly to one of the others. They are both well connected by bus straight into the city.
El prat is well connected too by bus and train and you can take a taxi as it is not far.