Looping part of animation

how do I make an animation go to a point and then loop between 2 certain points while Shift is hold down, And then if I released Shift it continues and stops. I want it as sprinting animation for first person. Is it possible?

Use animation crossfade and keep the position on start