Excel checkBox

Sub LinkChecks()
i = 2
For Each cb In ActiveSheet.CheckBoxes
cb.LinkedCell = Cells(i, “D”).Address
i = i + 1
Next cb
End Sub

 

Delete at once CTL+G —> Special–> Objects

CheckBoxExample

 

Sub InsertCheckBoxes()
‘Update 20140506
Dim Rng As Range
Dim WorkRng As Range
Dim Ws As Worksheet
On Error Resume Next
xTitleId = “KutoolsforExcel”
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox(“Range”, xTitleId, WorkRng.Address, Type:=8)
Set Ws = Application.ActiveSheet
Application.ScreenUpdating = False
For Each Rng In WorkRng
With Ws.CheckBoxes.Add(Rng.Left, Rng.Top, Rng.Width, Rng.Height)
.Characters.Text = Rng.Value
End With
Next
WorkRng.ClearContents
WorkRng.Select
Application.ScreenUpdating = True
End Sub

 

 

This entry was posted in Uncategorized. Bookmark the permalink.