My cats have all learned to stay off counters, and they stay off the tables when I'm present (I know they go on them when I'm not there. The cats haven't learned how to cover their tracks yet...) I don't have a magic solution, though.
If they're going up when you're around, it may be an attention-getting activity. "Look at me, I'm a bad
kitty, you better come stop me!" The best way to deal with this is to ignore them, then give them attention when they get off.
Spraying water can work, but it takes time. And even after that it may not work.
It also depends on the situation. If one cat discovers that the counter is a convenient escape from another, you may not be able to stop it. We had one girl who did this.
We cleared off the top of the microwave cart, and started feeding her there. When she jumped on the counter we'd pull the "helpful dunce" routine: "Oh, poor little kitty! You tried
to jump onto your place and missed. Here, let me put you in your special place." After about six or eight weeks of helpful idiots putting her on the microwave cart and getting food and attention there (we made a point of petting her and giving her special attention whenever she was there, and stopping the moment a paw just happened to wander onto the counter) she finally decided that she'd rather be on the cart. After another six months or so, the dynamics changed and she didn't want the cart any more, but still stayed off the counter.
All I can say is try the ideas in the article, try to stay tuned in to where the cat's head is, be patient, and, as always with a cat, be prepared to not only fail in modifying their behavior but to discover that they've modified =yours=.