Lleida is on the AVE train route from both Madrid and Barcelona. If you land in Madrid, it will be a direct AVE trip of approximately 3 hours. If landing in Barcelona, the direct AVE train ride will be only an hour.
There is a direct bus connection between Andorra la Vella and Lleida operated by ALSA and Montmantell.
Lleida is quite small and you will easily be able to get to all parts of it on foot. There is a very efficient city bus system as well. Multiple lines of bus service are available from the train station.