At the airport, both in T1 and T2 there is the metro line L9 which connects with 3 urban metro lines. One of them is the L1, another the L5 and finally the L3. You have to buy a special ticket for the airport that costs 4,50€. If you want to go to Pl. Catalunya, Ramblas, Baririo Gótico, etc... You must take either the L1 or the L3 and it takes approximately 1 hour and 10 minutes. If you want to go to the Sagrada Familia you must take the L5 and it takes approximately 1h and 15 minutes.