How to Insert and Use Excel Form Control

 

 

 

 Turning On the Developer Tab

  • Go to the File tab in the ribbon. Click on it, and Excel will show you the Backstage view.

Go to File tab

  • Click on Options in the left-down corner.

Click Options menu

  • A box will appear.
  • Select Customize Ribbon.
  • At Main Tabs, check the Developer box.
  • Press OK.

Check Developer in Customize Ribbon

  • You will now see the Developer tab.

Developer tab in the Ribbon


Choosing the Desired Form Control

  • Go to the Developer tab.
  • Select the Enter option from the Controls group.

Select Insert option from Controls group

From the drop-down list, you can select any control button from the Form Controls section.


How to Use Form Controls in Excel

1. Form Control: Button

Steps:

  • Go to the Developer tab.
  • Select the Insert option from Controls.
  • From the drop-down, select the Button command from Form Controls.

Select Button from Form Controls

The cursor will now look like a plus (+) sign.

  • Drag the plus (+) sign and create a button.
  • Set a name for the button.
  • Right-click on the button and select Edit Text from the Context Menu.

Name the Button

  • Right-click on the button and select Assign Micro.

Assign Macro to the Button

  • Select New in the Assign Macro dialogue box.

Select New option in the Assign Macro box

  • A VBA module window will appear.
  • Enter the following code into the module and close it.
Sub Button1_Click()
UserForm1.Show
End Sub

Insert VBA Code for the Button

Note: We’ve already created a Userform, and the code will activate when the button is clicked.
  • Click the button, and you will see the UserForm.

Userform appeared after Button click


2. Form Control: Combo Box

Steps:

  • Go to the Developer tab.
  • Select the Insert option from Controls.
  • From the drop-down, select the Combo Box from Form Controls.

Select Combo Box from Form Controls

The cursor will now look like a plus (+) sign.

  • Drag the plus (+) sign and create a box.
  • To enlist the months, right-click on the box and select Format Control.

Assign Control for the Combo Box

  • In the Control tab of the Format Control dialogue box, put $C$5:$C$16 in the Input range.
  • When you select a month, the serial number of that month will be displayed in a cell. Insert $B$21 on the Cell link box.
  • Enter 12 to the Drop down lines box and press OK.

Set Control options for the Combo Box

The months are now displayed in the combo box.

Assigned values in the Combo Box

  • Select March, and the serial number will be displayed in cell B21.

Combo Box output

  • To get the month you selected in the combo box in cell C21, use this formula based on the VLOOKUP function and press Enter.
=VLOOKUP($B$21,$B$5:$F$16,2,TRUE)

VLOOKUP formula to get month

  • To get the Profit/Loss for the respective month you selected in the combo box in cell D21, use this formula based on the VLOOKUP function and press Enter.
=VLOOKUP($B$21,$B$5:$F$16,5,TRUE)

Get Profit or Loss from VLOOKUP formula

  • Select August from the combo box. The related data will be displayed in the second table.

Combo Box interaction with the table

  • To hide column B for better presentation, right-click on the column header.
  • From the Context Menu, select Hide.

Hide helper column

You now have a dynamic dataset with a functioning combo box.

Final output of Combo Box


3. Form Control: Check Box

Steps:

  • Select the Check Box from Form Controls.

Select Check Box from Form Controls

The cursor will look like a plus (+) sign.

  • Drag the plus (+) sign and create a box.
  • Name the box.
  • Right-click on the box and select Edit Text from the Context Menu.

Name the Check Box

  • To link a cell for the check box, right-click on the box and select Format Control.

Assign Control for the Check Box

  • When you check/uncheck the Check Box, a cell will show TRUE/FALSE. To link that cell, enter $H$6 in the Cell link box in the Control tab of the Format Control dialogue box.
  • Press OK to close the window.

Set Control options for the Check Box

If you check the box, you will notice cell H6 will show as TRUE.

Check Box output

  • To link this Check Box with our table, go to the Home tab.
  • From Styles, choose the Conditional Formatting drop-down menu.
  • Select New Rule.

Set Conditional Formatting for Check box

  • In the New Formatting Rule window, choose Use a formula to determine which cells to format from the Select a Rule Type bar.
  • Enter the following formula in the Edit the Rule Description box:
=AND($H$6=TRUE, $E5>0)
  • To choose a Fill color, click Format.

Set Formula for highlighting profit months with Check box

  • Select the Fill tab and the color you want.

Choose Color for profit months

  • Press OK to take you back to the New Formatting Rule.
  • Press OK to apply the change.

Complete Formatting Rule for profit months

If you check the box, you will see the months that have generated profit have been highlighted.

Check Box interaction with the table

  • Create another Check Box following the previous steps and link a cell.
  • Click Conditional Formatting and enter the following formula:
=AND($H$8=TRUE, $E5<0)
  • Select a formatting color.

Set Formula and color for highlighting Loss months with Check box

You should have 2 functioning checkboxes.

  • To hide linked cells for better presentation, right-click on the column header, and from the Context Menu, select Hide.

Hide helper column for check boxes

You have a dynamic dataset with 2 functioning checkboxes.

Final Check boxes output


4. Form Control: Spin Button

Steps:

  • Select the Spin Button from Form Controls.

Select Spin button from Form Controls

The cursor will look like a plus (+) sign.

  • Drag the plus (+) sign and create a box.
  • To rotate the months, right-click on the box and select Format Control.

Assign Control for the Spin button

  • In the Control tab of the Format Control dialogue box, put 1 in the Minimum value box.
  • Insert 12 as the Maximum value.
  • When you select a month, the serial number of that month will be displayed in a cell. Enter $B$19 in the Cell link box and press OK.

Set Control options for the Spin button

When you press the up/down button, numbers 1 to 12 will rotate in cell B19.

  • To get the month rotating as per the button, click on cell C19.  Enter the following formula based on the VLOOKUP function, and press Enter.
=VLOOKUP($B$19,$B$5:$F$16,2,TRUE)

VLOOKUP formula to get month with Spin button

  • To get the Profit/Loss for the respective month in cell D19, enter the following formula based on the VLOOKUP function and press Enter.
=VLOOKUP($B$19,$B$5:$F$16,5,TRUE)

VLOOKUP formula to get profit or loss with Spin button

  • Click the down button, and the Month and respective Profit/Loss will rotate.
  • To hide column B for better presentation, right-click on the column header, and from the Context Menu, select Hide.

Hide helper column for Spin button

You have a dynamic dataset with a functioning Spin button.

Final Spin button output


5. Form Control: List Box

Steps:

  • Select List Box from Form Controls.

Select List Box from Form Controls

The cursor will look like a plus (+) sign.

  • Drag the plus (+) sign and create a box.
  • To enlist the months, right-click on the box and select Format Control.

Assign Control for the List Box

  • In the Control tab of the Format Control dialogue box, enter $C$5:$C$16 in the Input range.
  • When you select a month, the serial number of that month will be displayed in a cell. Enter $J$6 in the Cell link box.
  • Select Single in the Selection type and press OK.

Set Control options for the List Box

  • The months are enlisted in the combo box.
  • When you select August, the serial number will displayed in cell J6.

List Box output

  • To link this List Box with our table, go to the Home tab.
  • From Styles, choose the Conditional Formatting drop-down menu.
  • Select New Rule.

Set Conditional Formatting for List box

  • In the New Formatting Rule window, choose Use a formula to determine which cells to format from the Select a Rule Type bar.
  • Enter the following formula in the Edit the Rule Description box:
=$J$6=$B5
  • To choose a Fill color, click Format.

Set Formula and color for highlighting months with List box

  • Hide the helper columns B and J.

Final List box output

If you select a month from the list box, that month will be highlighted. Here, we selected March, and the corresponding row is highlighted.


6. Form Control: Option Button

Steps:

  • Select the Option Button from Form Controls.

Select Option button from Form Controls

The cursor will look like a plus (+) sign.

  • Drag the plus (+) sign and create a box.
  • Right-click on the box and select Edit Text from the Context Menu.
  • Set a name for the box.

Name the Option button

  • Select the option button, right-click on the button, and select Format Control.

Assign Control for the Option button

  • When you check/uncheck the Option Button, a cell will show the Button. To link that cell, enter $G$5 in the Cell link box in the Control tab of the Format Control dialogue box.
  • Press OK to close the window.

Set Control options for the Option button

  • Copy the button and paste it in the next rows.
  • You will have 12 buttons like this for each month.
  • When you click a button, cell G5 will show its serial number.

Copy option buttons for rest of the rows

  • To link these Option Buttons with our table, go to the Home tab.
  • From Styles, choose the Conditional Formatting drop-down menu.
  • Select New Rule.

Set Conditional Formatting for Option buttons

  • In the New Formatting Rule window, choose Use a formula to determine which cells to format from the Select a Rule Type bar.
  • Enter the following formula in the Edit the Rule Description box:
=$G$5=$B5
  • To choose a Fill color, click Format.

Set Formula and color for highlighting months with Option buttons

  • Hide the helper columns B and G.

Final Option button output

If you select a month, you will see that particular row is highlighted. Here, we selected March, and the corresponding row is highlighted.


7. Form Control: Group Box

  • Select Group Box from Form Controls.

Select Group box from Form Controls

  • The cursor will look like a plus (+) sign.
  • Drag the plus (+) sign and create a box over the Check Boxes.
  • Right-click on the box and select Edit Text from the Context Menu.
  • Set a name for the box.

Name the Group box

  • To group the controls, select each one by pressing Ctrl and right-click on them.
  • Select Group from the Context Menu and select Group.

Group the control within Group box

Note: Users can not interact with Group Boxes. They only house other controls.

8. Form Control: Label

Labels don’t interact with users. They only showcase a certain value or text.

Excel Form Control Label


9. Form Control: Scroll Bar

  • Select Scroll Bar from Form Controls.

Select Scroll Bar from Form Controls

The cursor will look like a plus (+) sign.

  • Drag the plus (+) sign and create a box.
  • To rotate the months, right-click on the box and select Format Control.

Assign Control for the Scroll Bar

  • In the Control tab of the Format Control dialogue box, put 1 in the Minimum value box.
  • Insert 12 as the Maximum value.
  • When you select a month, the serial number of that month will be printed on a cell. Insert $B$19 in the Cell link box and press OK.

Set Control options for the Scroll Bar

When you press the Scroll Bar, numbers 1 to 12 will rotate in cell B19.

  • To get the month rotating, as per the button, click on cell C19. Enter the formula based on VLOOKUP function and press Enter.
=VLOOKUP($B$19,$B$5:$F$16,2,TRUE)

VLOOKUP formula to get month with Scroll Bar

  • To get the Profit/Loss for the respective month in cell D19, use this formula based on the VLOOKUP function and press Enter.
=VLOOKUP($B$19,$B$5:$F$16,5,TRUE)

VLOOKUP formula to get profit or loss with Scroll Bar

  • Hide the helper column B, and you will get this.

Final Scroll Bar output


Download Practice Workbook

Download this file to practice with the article.


Excel form Control: Knowledge Hub


<< Go Back to Learn Excel

Get FREE Advanced Excel Exercises with Solutions!

Tags:

Mehedi Hassan
Mehedi Hassan

Mehedi Hassan, having earned a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, functions as an Excel & VBA Content Developer at ExcelDemy. His deep interest in research and innovation aligns seamlessly with his fervor for Excel. In this role, Mehedi not only skillfully addresses challenging issues but also exhibits enthusiasm and expertise in gracefully navigating intricate situations, emphasizing his unwavering dedication to consistently delivering outstanding content. His interests are Advanced... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo