The voltmeter divider needs to be of values to suit the input such that no more than 5v is put on the input pin at your highest test voltage.
Therefore if the highest voltage is 10v, you have two Rs the same, say 10k each. If the the highest voltage is 25v, you need a ratio of 4:1 so you read only a fifth of the voltage. Your software then converts the reading to actual voltage.
The R values chosen should be such that the divider total R is over 10k and under 50k. As you can only get certain values of standard Rs, you will need to build in a calibration factor into your software.
It is preferred that with the digital input that the R goes from 5v to the input and the switch goes to gnd.