Forum Discussion
Copying a Check Box to other cells
LPONG0413 if the checkboxes are in the same column, you could just add the checkbox into the first cell of that column and then drag the fill handle down (not the checkbox itself, just the cell).
You will see the names of the checkboxes to appear the same, but the backend name of each object will have a different name.
There is a downside to this approach: if the first checkbox is linked to specific cell, then all other cells will be linked to the same cell and you would need to link each checkbox manually.
Let me know if this helps.
Cheers,
Branka
- LPONG0413Jan 05, 2020Copper Contributor
- Branka BraduleJan 05, 2020Brass Contributor
LPONG0413 Great news!
- Riny_van_EekelenJan 06, 2020Platinum Contributor
Notice SergeiBaklan 's comment! You still need to link each and every box to a cell 4999 times after copying it. The following macro could help out here. It creates 5000 checkboxes with a text label "YES", each linking to its own cell in column B. In this particular example the size of each box is 120 pixels wide by 30 pixels high. The first one will be put at coordinate (0, 0) i.e. top left corner of the sheet. Each following box will be placed 30 pixels below the previous one. If you set the row height to 30 for all rows, it'll work nicely. Of course, you may change the parameters to meet your own needs.
Sub Macro1() Dim NextLoc, i As Integer NextLoc = 0 For i = 1 To 5000 ActiveSheet.CheckBoxes.Add(0, NextLoc, 120, 30).Select With Selection .Value = xlOff .Characters.Text = "YES" .LinkedCell = "$B$" & i .Display3DShading = False End With NextLoc = NextLoc + 30 Next i End Sub
- LPONG0413Jan 05, 2020Copper Contributor
I tried that too but everytime I tried to select the cell (not the check box) it's like clicking the check box to "check" or "uncheck" it.
When I right-click the cell, the check box is "selected" and that is what I can copy and paste but only to one cell at a time.
- SergeiBaklanJan 05, 2020Diamond Contributor
You may navigate to the cell under check box with arrows, when press and hold Shift, scroll down till end of your range (other words select it), release Shift and press Ctrl+D.
The only you'll need 4999 times to link appeared check boxes to cells.