The only way from Dietikon to Barcelona is by flight. You should expect to be able to find tickets starting around $357, if you search flights from ZRH to BCN. The best time to book long flights is 5-6 weeks before your trip.
For these medium length trips, it's important to book your tickets as soon as possible. While there are flight transportation options available, the sooner to book the better. While prices for buses or trains might not fluctuate as much as flights, their availability certainly will. It's recommended to book these flights at least 2 weeks away, but even more if you are able.