I got this procedure off of one of the audi web sites, I think. It worked on my '97 A4.
To do this, you will need two keys (but it's OK if you only have one remote).
- Put one key in the ignition and turn the switch to the "on" position (don't start the car but rotate the key to the position just before you'd activate the starter; the accessories and instrument panel lights will come on).
- Roll down the driver's window (just in case!).
- Get out of the car, holding the 2nd key and the remote in your hand. With the 2nd key (don't use a remote), lock the door from the outside, and leave the key in the door.
- With the remote you're programming, press the button to open the door. Now at this point, the instructions I had said that the door should unlock, and that your remote would then be programmed. On my car, the door did NOT unlock when I did this step. However, once I removed the key in the ignition, the remote worked fine, and has worked well ever since.
I bought a remote on ebay after both of mine stopped working, and I was able to program it using this method. Note that the remotes changed from year-to-year, so I don't know whether this would work on a '96 or a '98, but it does work on the '97.
Hope this helps, and good luck.
Brad