In Lego Harry Potter: Years 5-7 for the PS3, Wii, and Xbox 360, there are several codes you can enter for various different effects.
To enter cheat codes, pause the game and go to Extras. Enter one of the following codes for the desired effect.
Carrot Wands – AUC8EH
Character Studs – H27KGC
Character Token Detector – HA79V8
Christmas – T7PVVN
Extra Hearts – J9U6Z9
Fall Rescue – ZEX7MV
Fast Dig – Z9BFAD
Gold Brick Detector – 84QNQN
Ghost Studs – 2FLY6B
Hogwarts Crest Detector – TTMC6D
Invincibility – QQWC6B
Red Brick Detector – 7AD7HE
Score x2 – 74YKR7
Score x6 – XK9ANE
Score x8 – HUFV2H
Score x10 – H8X69Y
Super Strength – BMEU6X