For these two codes, follow these directions.
Press L+R to get 32 of each Vitamin in the Medicine bag.
Trash as many of each Vitamin as needed to have the number of item left equal to the IV you want in the stat corresponding to the Vitamin (e.g. HP UP for HP, Protein for Attack, etc.).
For 0 EV in the stat, simply leave 32 items (don't trash anything).
Once you have the good number of Vitamins, go to your Pokemon's Summary Page and press Start+Select.
Some Rebattle codes may have Glitches when using them, but you don't have to worry about it. Yes, these codes can retrigger other Flags, but don't worry about this either.
Yes, have a look at my thread. Click my Userbar in my Signature to go to my thread. The code is called Pokewalker Route Modifier.