Light fixture switch not working - extra wires in box
hammerlane beat me too it but I'll add for OP sake!
OP, you need to determine your switch leg and circuit (power) wires. If the wires are lose in the ceiling box then wire nut the two wires in the switch box together, then check for continuity in the ceiling box in determining which two wires are the switch leg wires.
After you do that, set those apart and clearly mark them. Now it's only a matter of determing which wires in the ceiling box are circuit wires (power). You'll also need to provide more details as to the other wires and/or a picture. Some of those probably just continue on to other fixtures and the two capped ones are most likely dead wires(no longer used).
Now look at hammerlanes simple example. If all the other wires just continue on to provide power to other fixtures then use his example for your multiple wires. Just wire nut all the whites together, in addition to a short white wire that will be used for the light fixture. Now wire nut all the black wires together, in addition to the white wire from the switch leg. The black wire from the switch leg will be the second wire for the light fixture. You should have a black and white wire hanging for light fixture at this point(see example). THIS would be typical but it is up to you to determine exactly what the wires are used for!
Last edited by Ralph III; 05-01-2012 at 02:53 PM.