Forum Discussion
LPONG0413
Jan 05, 2020Copper Contributor
Copying a Check Box to other cells
I am doing a sheet where I need a check box in each of the 5000 rows. I would appreciate any help in doing it other than pasting a check box 4999 times. Thank you! lpong0413
GGEXEL
May 09, 2024Copper Contributor
check this code I found. simple and effective solution. I have just ran it for 5,000+ lines and crashed Excel... it worked fine for less during testing.
https://www.youtube.com/watch?v=cqq6lS23lGM
VBA CODE:
Sub LinkCheckBoxes()
Dim chk As CheckBox
Dim lCol As Long
lCol = 3 'number of columns to the right of checkbox
For Each chk In ActiveSheet.CheckBoxes
With chk
.LinkedCell = _
.TopLeftCell.Offset(0, lCol).Address
End With
Next chk
End Sub