Then have the software sample each scale to see which is the best fit (lowest setting). If you sample from little to big it will be the first reading that is not at max or min.
Nigel has a tutorial on using op amps to scale analog input. It includes info on building the hardware on vectorboard but you can do it anyway you desire.
I think Microchip has an appnote on building a voltmeter. Not sure if it is auto ranging.