Switch has only 3 wires. 1 black, 1 white, 1 neutral. They are coming from outlet. No other incoming power source. Outlet has a source to the bottom half. Top half is controlled by the switch. Can I pull the wires for ceiling fan from the switch though there is no direct power source to the switch - other than it acts as a toggle for the outlet power.
You run a cable from the ceiling to either the switch or the receptacle. You then need to change the connections in the outlet, and if you route to the switch you will need to change those terminations too. If you route to the switch you will lose the switched receptacle.
There are so many actual ways to make the terminations at the receptacle that you would really need to post a picture of the wires connected to the receptacle to get advice which terminations to intercept.
But basically if you route to the switch you get a new receptacle and connect all the blacks to the gold screw (small slot) side of the receptacle, and the whites to the silver screw (tall slot) side. Then at the switch connect whites together and blacks to the switch.
If you run to the receptacle you can either reconfigure to eliminate the switched receptacle or not. This is where a picture is needed, but essentially you connect the new cable to the terminals or wires connected to the switched portion of the receptacle. You will need to concerned the code limits the number of wires in a box based on size of the cu. in. of the box. Gauge of wire is needed to calculate.
Edit. You should replace the receptacle, re-using stab back receptacles produces questionable results. You will also need a few new wire connectors (tan wingunts) and a 4" piece of white wire.
Turn off the power, connect all ground wires together and pigtail to devices.
At the switch where you ran the new cable connect white to white using a yellow or tan wire connector, and blacks to the switch.
At the receptacle box remove the white from the red wire connector, and all the wires from the old receptacle. Connect all black wires and a black jumper together in a new tan (or red) wire connector. Form a hook at the end of the black jumper wire (using a hole on the wire strippers) and connect to a brass screw on the new receptacle.
Connect all the white wires and the new 4" jumper together in a new tan (or red) wire connector, connect the jumper to a silver screw.
Since you're running a new cable to a fan ceiling box that you will install you're going to have to source your power from the receptacle box since there isn't a neutral in the switch box. It probably doesn't make sense to have your wall switch activate both the fan and the outlet so I'll assume you want the switch to power the fan. You will then have constant power to the entire outlet (upper and lower). In order to accomplish this, do the following:
- Turn off the power and while following all proper safety precautions and following local codes, run your cable (14/2 w/ground if a 120v 15amp circuit) from the ceiling box into the wall outlet box. Remove the outlet completely (you'll be replacing it) and wirenut the hot-switched wire from the switch (top outlet) to the black wire going to the fan. Connect the white neutral wire that was connected to the upper switched outlet to the white wire going to the fan. This will through-wire the switched hot and the neutral to your fan ceiling box.
- Next purchase a new wall outlet and do not remove the connector between the upper and lower receptacles. Wire this new receptacle to the constantly hot black wire remaining in the box (brass screw) and the remaining white neutral (silver screw). Connect the wires using the screws rather than the backstabs. Connect all of the bare ground wires. This setup will result in the switch controlling the fan and the entire outlet being constantly hot.
- Importantly, make sure that you are properly installing a fan-rated ceiling box so it will support the weight and vibration of a fan.