Not sure I understand your circuit. One end of 47k resistor at GND, other end at Portb.x. One end of switch to portb.x, other end to +5. If this is it, it would seem that you could get floating voltage at portb pin. I believe a more common circuit would be resistor between +5 and portb as pullup, switch between portb and ground.

I use portb for inputs on 16F876A with no problems.

Others with more expertise feel free to correct me.