I have 3 DIP switch packages with 8 switches each, and not enough inputs on my microcontroller. This article (you have to download the pdf to see the schematic) gives an example of what I want to do.
In the comments section, many people say the circuit won't work. I disagree; It looks like those commentators missed the fact that one of the lines is drawn as an 8 pin bus, and the fact that unused RA pins will be set as high impedance inputs. Still, I wanted to get a second opinion from the experts here!
Edit: After reading the many good answers to this question it seems my initial impression was wrong. This circuit will only work for momentary push buttons, not dip switches.