Question: how to program a universal remote when the tv is off?
Answer: Press and hold the "Program" button on your remote. ... 
Choose the "TV" option on your remote. ... 
Enter the code in your remote's manual that correlates to your TV using the remote's number pad.
Press the "Program" button again to finish programming the remote.