Written by Allen Wyatt (last updated February 1, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003
Eric asked if there was a way to quickly fill a column with a large number of checkboxes bound to a particular cell. Excel allows you to easily add a checkbox by using the Forms toolbar. This type of checkbox is very similar to checkboxes you would use if you created a dialog box. You can adjust the size, location, and other properties of the checkbox. Especially helpful, you can bind or link the checkbox to any cell in your worksheet. When you select the checkbox, the value of the linked cell changes. Conversely, if you change the value of the cell, the status of the checkbox also changes.
In reality, a checkbox placed in this manner is related to two different cells in your worksheet: the cell over which it is placed and the cell to which it is linked. The linked cell behaves in relationship with the checkbox as described above. The cell over which it is placed becomes the checkbox's anchor, so to speak, determining where the checkbox is displayed.
It takes time to place a checkbox and set its properties just right. The biggest time-consuming tasks are getting the checkbox to be the right size and linking each checkbox to a different cell in the worksheet. You can make the job of placing a large number of checkboxes a bit easier by following these steps:
It is important to realize that by doing this you save a great deal of time, but you don't save all the setup time you might want to. Even though you may place fifty checkboxes in this manner, all the checkboxes are still linked to the same cell. Thus, a change in the "selected" state of one checkbox results in a change to them all. The only way around this is to individually select each checkbox, display its properties, and modify the linked cell. So where do the time savings come from? In not having to place, size, and align each of the checkboxes individually.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (1964) applies to Microsoft Excel 97, 2000, 2002, and 2003.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Excel provides worksheet functions that make it easy to count things. What if you want to count records that match more ...
Discover MoreIndirect references can be very helpful in formulas, but getting your head around how they work can sometimes be ...
Discover MoreThe DSUM function is very handy when you need to calculate a sum based on data that matches criteria you specify. If you ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-09-12 14:48:08
Becky Breeden
Wow. Excel is not a good product if you have to link each individual checkbox to a cell. Not good.
2020-07-11 01:26:25
Craig M
Putting this in a macro works.
'Makes all the checkboxes have a link cell one cell to the right.
Dim chk As CheckBox
Dim lCol As Long
lCol = 1 'number of columns to the right for link
For Each chk In ActiveSheet.CheckBoxes
With chk
.LinkedCell = _
.TopLeftCell.Offset(1, lCol).Address
End With
Next chk
2020-05-22 19:38:05
Alfonso M
Link the Check Boxes to Cells - Use Programming to Create Cell Links
Per
https://contexturesblog.com/archives/2014/01/14/click-a-cell-to-check-yes-or-no/
Sub LinkCheckBoxes()
Dim chk As CheckBox
Dim lCol As Long
lCol = 2 'number of columns to the right for link
For Each chk In ActiveSheet.CheckBoxes
With chk
.LinkedCell = _
.TopLeftCell.Offset(0, lCol).Address
End With
Next chk
End Sub
2017-02-27 19:13:19
Norm
I tried this, and it only copies to one row, generally skipping the first row under the copied checkbox, makes one copy, and no other rows down the column. Very frustrating.
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments