:'<,'>s/this/to that/g
I think vim does that automatically when you have a selection active and hit :
So you might consider using :'<,'>s/\%Vthis/to that/g
this ipsum dolor sit amet
select the middle 3 lines and do what I said will give you:
to that ipsum dolor sit amet
So you might consider using :'<,'>s/\%Vthis/to that/g