How to Create, Configure and Use Form Controls and ActiveX Controls Scroll Bars in Excel 2007 and Excel 2010
Welcome to my latest hub on Excel 2007 and Excel 2010. Today, I will be investigating the use of the Format Controls and ActiveX Scroll Bars. A user using a Scroll Bar can use the slide, click on the arrows at either end or click on bar itself to quickly and easily select the value they desire. This value is then stored in the spreadsheet which can then be displayed immediately on the worksheet and or stored for future use. They are not only easy to use and visually appealing, they also reduce errors and control the users input into your spreadsheet.
Today, we are going to create two Scroll bars, one Form Controls and one an ActiveX Controls Scroll Bar. You can see these below (the Form Control bar is on top).
Form Controls versus ActiveX Controls scroll bars
There are two types of scroll bars, Form Controls and ActiveX Controls:
- Form Controls are simpler to use and configure. Unless you have a need to use an ActiveX Controls scroll bar, I would recommend using Form Controls.
- ActiveX Controls have far more flexibility than Form Controls. Using ActiveX Controls allows you to change the colour and text used, the mouse pointer in your scroll bar among other things. You can also use Visual Basic with ActiveX bars.
Note: ActiveX Controls are not Mac compatible.
The figure below shows the configuration options available for Format Controls scroll bars (left and middle) and ActiveX Controls scroll bars (all three).
Adding the Developer tab
Before beginning, if the Developer tab is not added by default you will need to enable it. To do this:
If you are using Excel 2007:
- Click the Excel button
- Select Excel Options
- Under Popular, check Show Developer tab in the Ribbon
For those using Excel 2010:
- Select the File menu
- Click Options
- Select the Customize Ribbon tab
- Under Main Tabs tick Developer as shown below
Creating and configuring a Form Controls scroll bar in Excel 2007 /andExcel 2010
First we need to create a scroll bar. To do this:
- Click on the Insert button and select Scroll Bar in the Form Controls section. The Insert button can be found on the Developer tab in the Controls group
- The cursor will change to a cross. Left click and drag to create the dimensions of your scroll bar
Now we have created the scroll bar, we need to configure it:
Configuring a Format Controls scroll bar in Excel 2007 and Excel 2010
Right click the scroll bar and select Format Control
- On the Size tab, you can specify the exact Height and Width (this is extremely useful if you have a number of scroll bars and you want to ensure they are exactly the same size)
- Next, select the Control tab. This has a number of values you will want to adjust to fully configure your scroll bar
- Minimum value: will likely be zero, but change this if it is required to be higher
- Maximum value: as with the minimum, adjust this as required
- Incremental change: if you click the arrows at either end of the scroll bar, how much the number will increase by
- Page change: if you click on the scroll bar itself, how much the number will increase by
- Cell link: This is the cell that displays the number that the user selects when using the scroll bar
- 3-D shading: Enables or disables 3-D shading
Note: Excel 2007 or Excel 2010 does not allow fractions within scroll bars. If you enter 0.5, Excel will change this to 0. If you want to use fractions, you will need to perform additional calculations on the results from the scroll bar.
Now to an example. I want users of my spreadsheet to select the interest rate of the mortgage they are interested in.
- First I create a scroll bar with the following values selected on the Control tab
- I chose to link my scroll bar with $M$3 as I need to convert this number to interest rates going up by .25% from 1 to 1.25 to 1.5 to 1.75 to 2 and so on.
To achieve this, I add a formula to H6 which is the cell above the scroll bar as shown below.
The formula creates the fractions I require (the /100 is because the cell is formatted as a %)
Note: (M4 is the Linked Cell for this Scroll Bar)
Working with ActiveX Controls scroll bars in Excel 2007 and Excel 2010
Creating an ActiveX Controls scroll bar is exactly the same as creating a Form Controls bar (except you choose the scroll bar in the ActiveX Controls section via the Insert button).
You also configure an ActiveX Controls bar identically using Format Control as above.
Where ActiveX Controls bar differ is that they have additional options.
Note: to reconfigure an ActiveX Controls scroll bar, you need to be in design mode. To access this, click on the Design Mode button on the Developer tab in the Controls group.
Note: Unless you are in design mode, you will not be able to right click on your scroll bar.
To access the additional options:
- Right click on your scroll bar while in design mode
- Select Properties
As you can see from the figure above there are a number of options you can configure. A number of these are identical to those we configured when we configured the Form Control bar. The options that are unique to ActiveX Control bars include:
- BackColor: the colour of the scroll bar itself
- ForeColor: the colour of the arrows and the shadow (should you select it)
- MouseIcon: allows you to use a picture as the mouse icon (should you want to)
- MousePointer: allows you to select another pointer other than the default
You can also add Visual Basic code to your ActiveX button by right clicking the button and selecting View Code.
Scroll Bars allow you to control user input which both reduces errors and also improves the user experience. They are visually appealing, and scroll bars are easy and intuitive to use as users are very familiar with them. In this hub, I introduced both the Form Controls and ActiveX Controls scroll bar and using an example showed how to create and configure both. The ActiveX Controls bar has more options available compared to the simpler Format Controls bar.
In addition to scroll bars, I also have a number of hubs that investigate other controls available in Excel 2007 and Excel 2010. These include:
Combo Boxes use a configurable list to create a button with a drop down list suited for small lists such as days of the week, months of the year etc. My hub for Combo Boxes can be found here:
Using Check Boxes you can select or deselect a check box. They are very useful for lists or for Yes / No, On / Off lists. You can also use Conditional Formatting to change the text colour based on the result of the check box. I also have a hub for Check Boxes that can be found here.
Both Combo boxes and Check Boxes are made more powerful and useful when they are used in conjunction with Conditional Formatting. Conditional Formatting allows you to change text or cells using rules so that as in the figures above when a task is completed the text for that task is turned green and when it is outstanding it is red or, it has a tick (or check) next to it when complete or a cross if it is incomplete. My hub on Conditional Formatting can be found here:
Command Buttons are used to create a click able button in Excel that performs a specific function. In my example I created a reset button that resets the sheets combo boxes or check boxes to default using Visual Basic scripting. My hub on Command buttons can be found here:
Many thanks for reading; I hope that you found it not only interesting but also informative and useful. Please feel free to leave a comment below.
This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.