Spain has three consulates in Switzerland: Bern, Geneva and Zurich. Registering at one of them is not a mere formality: it is consular registration, the official registration as a Spanish national residing abroad. It is done once, when you arrive and settle here. And many Spaniards who have been here for five, ten or fifteen years have never done so.
What this registration entails: you are registered on the Register of Spaniards Residing Abroad (PERE), which is the official census of the Spanish community outside Spain. The consulate is aware that you live here, and you can vote in Spanish elections from Switzerland. If you are not registered with the PERE, voting in general or European elections from here becomes considerably more complicated, because the system locates you in your former municipality in Spain and you have to go through additional procedures that most people end up giving up on halfway through.
What few people realise is that registering as a resident at the consulate has a formal effect in Spain: you are removed from the municipal register where you were previously registered. This does not always happen automatically, but consular registration as a ‘resident’ will eventually result in this. This has implications for inheritance procedures, access to certain services in Spain, or situations where your tax residence still matters. The consulate responsible for your area depends on the canton where you live: Geneva covers Vaud, Valais and Geneva; Bern covers Basel, Neuchâtel, Jura, Fribourg, Bern and Solothurn; Zurich covers the rest. If you’ve been here for years without registering, it’s worth checking what the implications are for your situation before deciding whether or not to do so.