Changing the range should automatically adjust the gain to apply the entire resolution to the new range. For example, if the range is +/-5V, then the gain is set to 1. If the range is +/-50mV, the gain will be set to 100. On the other hand, if you change the gain, the range will change.
The best way is to change the range to the range of you signal.