Changing Slider attachment range

I have 2 buttons and a slider.

I need to change slider attachment range depending on what button is clicked.
Let’s say if the 1st button is clicked I want the slider to change its value from 0 to 1000
and if the 2st button is clicked I want the slider to change its value from 1001 to 2000

Is it possible to do with standard juce means?