How to install 3-speed switch for ceiling fan
It's even worse than the above answers.  There is no general standard for fan designs.  Different fans do speed regulation different ways, and you must choose a remote speed control method which is compatible.  This is a "consult with the factory" sort of situation; often cheaper fans are simply not made for that.