It is in the manuel for the Sport Trac. I would think it is for the Ranger as well.
You can a manuel for your Ranger on-line for free.
(For the Sport Trac).
How to reprogram your remote entry transmitters
You must have all remote entry transmitters (maximum of four)
available before beginning this procedure.
To reprogram the remote entry
transmitters:
1. Ensure the vehicle is
electronically unlocked.
2. Put the key in the ignition.
3. Turn the key from the 2 (LOCK)
position to 3 (OFF).
4. Cycle, eight times, rapidly (within
10 seconds) between the 3 (OFF) position and 4 (ON). Note: The
eighth turn must end in the 4 (ON) position.
5. The doors will lock, then unlock, to confirm that the programming
mode has been activated.
6. Within 20 seconds press any button on the remote entry transmitter.
Note: If more than 20 seconds have passed you will need to start the
procedure over again.
7. The doors will lock, then unlock, to confirm that this remote entry
transmitter has been programmed.
8. Repeat Step 6 to program each additional remote entry transmitter.
9. Turn the ignition to the 3 (OFF) position after you have finished
programming all of the remote entry transmitters. Note: After 20
seconds have passed, you will automatically exit the programming mode.
10. The doors will lock, then unlock, to confirm that the programming
mode has been exited.