One of the most demanding and fascinating things for an Excel user is to create interactive things in Excel. And a checkbox is a small but powerful tool that you can use to control a lot of things by unchecking/checking it.
In short: It gives you the power to make your stuff interactive. And, I’m sure you use it in your work, frequently. But, the thing is: Do you know how to use a checkbox up to its best? Yes, that’s the question.
In today’s post, I’m going to show you exactly how you can insert a checkbox in Excel and all the other things which will help you to know about its properties and options. So without any further ado, let’s explore this thing.
Steps to Insert a Checkbox in Excel
Here you have two different methods to insert a checkbox. You can use any of these methods which you think are convenient for you.
- First of all, go to the developer tab and if you are unable to see the developer tab in your ribbon, you can use these simple steps to enable it.
- In the Developer Tab, go to Controls → Form Controls → Select Checkbox.
- After selecting the check box click on the place on your worksheet where you want to insert it.
This is another method to insert a checkbox, you can use the following VBA code.
ActiveSheet.CheckBoxes.Add(left, Right, Height, Width).Select ActiveSheet.CheckBoxes.Add(80, 40, 72, 72).Select
Using the above method is only helpful when you exactly know the place to insert and the size of the checkbox. Learn more about this method here.
Link a Checkbox with a Cell
Once you insert a checkbox in your worksheet the next thing you need to do is to link it with a cell. Follow these simple steps.
- Right-click on the check box and select format control.
- Now, you’ll get a format control dialog box.
- Go to the control tab and in the cell link input bar enter the cell address of the cell which you want to link with the checkbox.
- Click OK.
- In the cell which you have linked with your checkbox, you’ll get TRUE when you tick the checkbox and FALSE when you un-tick.
Deleting a Checkbox
You can delete a checkbox using two ways. The first way is to select a checkbox and press delete. This is a simple and fast method to do that.
And if you have more than one checkbox in your worksheet. Select all the checkboxes by holding the control key and pressing delete to delete them all. The second way is to use the selection pane to delete them
- Go to Home Tab → Editing → Find & Select → Selection Pane.
- In the selection pane, you will get the list of all the checkboxes you have used in your worksheet.
- You can select each of them one by one or you can select more than one by using the control key.
- Once you select them, press delete.
Printing a Checkbox
Most of the time users avoid printing a checkbox. But if you want to do that you can enable this option by using the following way.
- Right-click on the checkbox, and select Format Control.
- Go to Properties Tab.
- Tick mark “Print Object”.
This will allow you to print check boxes, and if you don’t want to print them make sure to untick this option.
Resizing a Checkbox
If you want to resize the checkbox you can simply expand its size by using dots from its border. And, if you want to resize it using a particular height and& width, you can do it by using the following steps.
- Right-click on the checkbox and select the format control option.
- Go to Size -> Tab Size and Rotate.
- Enter the height and width that you want to fix for the checkbox.
- Click OK.
Quick Tip: To lock the aspect ratio for the size of the checkbox tick mark “Lock aspect ratio”.
Copy a Checkbox in Multiple Cells
You can use three different ways to copy a checkbox from one place to another.
Select a checkbox.
- Right-click on it and copy it.
- Go to the cell where you want to paste that checkbox.
- Right-click and paste.
Use Control Key
Select a checkbox.
- Press the control key.
- Now with your mouse, drag that checkbox to another place where you want to paste it.
Using Fill Handle
Select the cell on which you have your checkbox.
- Use the fill handle and drag it up to the cell on which you want to copy the checkbox.
Renaming a Checkbox
While renaming a checkbox, there is one thing you have to keep in mind you have two different names associated with a checkbox. Caption name and an actual name of a checkbox.
- Question: How to change the caption name of a checkbox?
- Answer: Right-click and select edit text and then delete the default text and enter new text.
- Question: How to rename a checkbox?
- Answer: Right-click on the check box. Go to the address bar and edit the name. Change to the name you want and press enter.
Fixing the Position of a Checkbox
By default when you insert a checkbox in excel it will change its position & shape when you expand the cell on which it is placed.
But you can easily fix its position using these steps.
- Right, click on the checkbox, and go to Format Control → Properties Tab.
- In object positioning, select “don’t move or size with cell”.
- Once you select this option, the checkbox will not move from its position by expanding the column or row.
Hide or Un-hide a Checkbox
You can also hide or un-hide a check box from your worksheet using these steps.
- Open the selection pane by using the shortcut key Alt + F10.
- On the right side of the name of every checkbox, there is a small icon of an eye.
- Click on that icon to hide a checkbox and the same icon again to unhide it.
- If you want to hide/unhide all the checks boxes you can use the hide all button and show all buttons to show all the checkboxes.
How to use Checkbox in Excel
Here I have a list of useful ideas to use as a checkbox in your spreadsheet.
Creating a Checklist
In the below example, I have used a checkbox to create a checklist. And, I have used formulas in conditional formatting to create this checklist.
- Insert a check box and link it to a cell.
- Now, select the cell in which you have the task name and go to Home Tab -> Styles -> Conditional Formatting -> New Rule.
- Click on “Use a formula to determine which cell to format” and enter the below formula into it.
- Apply formatting for strikethrough.
- Click OK.
Now, whenever you tick the checkbox it will change the value in the linked cell to TRUE, and the cell in which you have applied conditional formatting will get a line through a value.
Create a Dynamic Chart with a Checkbox
In the below example, I have created a dynamic chart using a line chart and a column chart.
- Create a table with profit values and link it to another table using the below formula.
- Then linked $I$17 with the checkbox.
- Whenever I tick that checkbox, the above formula will use VLOOKUP Function to get profit percentages. And, if a checkbox is unticked I’ll get a #N/A.
Use Checkbox to Run a Macro
While working on an invoice template I got this idea. The idea is if you want to insert the shipping address the same as the billing address you just have to tick the checkbox and the address will be copied to it. And, on the other side when you untick that checkbox content will be cleared.
- Go to the Developer Tab → Code → Visual Basic or you can also use the shortcut key to open the visual basic editor.
- Add below VBA code to the sheet in which you have inserted your checkbox.
Sub Ship_To_XL() If Range(“D15”) = True Then Range("D17:D21") = Range("C17:C21") Else If Range(“D15”) = False Then Range("D17:D21").ClearContents Else: MsgBox (“Error!”) End If End Sub
Please note you have to insert this code into the code window of the same worksheet in which you want to use it. In the above code, D17:D21 is the range for the shipping address and C17:C21 is the range for the billing address. In cell D15, I have linked the checkbox.