the red gear was on the end right?

wiggle it as you fit, you should feel the tip of the gear drop into a locating hole in the gearbox casing. Then drive the car a short distance while you watch the pin inside the cable, you should see it spin, if so you know box end and cable is all fine. Push the squarte pin into the cable as much as you can, then fit it to the speedo with a good hard shove, whilst twisting the cable. it can be REALLY tight, you should feel it click solidly into place. If it STILL doesnt work take the speedo out again and look at the square hole in the back. see if you can find something that fits into here and spin it quickly by hand, the speedo should move!