You can't through any legal means, but it is possible via cheating, using an Action Replay, editing the .sav file or editing the games cache while running by emulating it on a PC.
On Pokemon emerald, just clone 99 Pokemon holding a rare candy.
the answer is d94edd0
Yes threre is a way, you can catch a couple of meowths and they might pick up rare candies. You can also trade to Emerald and copy them.
Master Code: D8BAE4D9 4864DCE5 A86CDBA5 19BA49B3 Rare Candies Code: BFF956FA 2F9EC50D Be sure to enable these codes and in your bag,in the items section...you will find 99 rare candies. :)
Buy an action replay and set it to 999 rare candies
action replay
action replay
you give rare candies to 99 pokemons and trade them to heart gold... time consuming? yes, but it should work unless it doesnt allow you to trade pokemon holding rare candies.
trades, AR or hacking
Battle a lot, or use Rare Candies.
sorry,but it seems that there is no cheats that
you have to buy actionreplay and get lots of rare candies