Using multiple subranges in CurveFit

Is it possible to use multiple subranges while using CurvFit?  

 

For example, I would like to fit a line to the first 5 points and the last 5 points, so that I may subtract this baseline fit from the full wave. Currently, I've been duplicating the wave, deleting the interior points, and fitting what remains, but it would be nice if there is a way to achieve the same result by single execution of CurveFit. 

 

Thanks!

Use a mask wave to select the points to be fitted. See the help using this Igor command: DisplayHelpTopic "Fitting a Subset of the Data". In that help topic, scroll down until you find Using a Mask Wave.