I learned this "trick" at the 2003 ICTCM, and have used it a couple of times since then—but not frequently enough that I can remember exactly how to do it from one time to the next. This page is here in part so that I have the instructions available the next time I want to do this ... but others might find it useful, too.

These instructions and pictures are Windows-centric, but Mac users can follow the steps almost exactly as they are given here.

Some alternate resources are given below.


In this demonstration, we create a spreadsheet to show the effect of changing a and b in the function y = sin(ax+b). You can download that spreadsheet to see the finished product. Here is a picture of the initial step of the process; the values of a and b are stored in cells D1 and D2, and the formula in cell B2 is =SIN($D$1*A2+$D$2).
Click on image to see a larger view.
To add slider controls, you first need to see the "Forms" toolbar. Choose "View: Toolbars: Forms" (see the first image on the right). This brings up the floating Forms toolbar (shown in the second image). If you wish, you can drag this toolbar up to the top of the Excel window and leave it there with the other toolbars; if you do this, it should be there the next time you start up Excel.
Click on image
to see a larger view.

Click on image
to see a larger view.
Select the "Scroll bar" tool, then click-and-drag to create a "slider" control. You can re-size or move the slider now, or do it later by first selecting it with a right-click.
Click on image to see a larger view.

By right-clicking on the slider, you bring up the menu shown here:

Choose "Format control..." to link the movement of this slider to the contents of a cell.

We would like the value of b, in cell D2, to range from 0 to 1. However, slider-controlled cells must have integer values between 0 and 30000. The solution is that we link this slider to cell E2, with values ranging from 0 to 100, and then put the formula =E2/100 in cell D2.

If we want a second slider to control the value of a (in cell D1), ranging from –1 to 1, we link the slider to cell E1 ranging from 0 to 200, and then enter the formula =E1/100-1 into cell D1.




Here are some other links to similar tutorials I found on the Web. (Some illustrate a slightly different approach to setting up the sliders, using the "Control Toolbox" instead of the Forms toolbar.)