TaskMaster
Board Regular
- Joined
- Oct 15, 2020
- Messages
- 75
- Office Version
- 365
- 2016
- Platform
- Windows
Hi all,
I currently have to highlight all of my cells which contain the word Yes and use the following to add in a checkbox. Is there a way to automate this so rather than selecting the range it just does it where the cell is Yes?
I currently have to highlight all of my cells which contain the word Yes and use the following to add in a checkbox. Is there a way to automate this so rather than selecting the range it just does it where the cell is Yes?
VBA Code:
Sub InsertCheckboxes()
Dim c As Range
For Each c In Selection
Dim CB As CheckBox
Set CB = ActiveSheet.CheckBoxes.Add(c.Left, _
c.Top, _
c.Width, _
c.Height)
With CB
.Caption = ""
' .Value = xlOff
' .LinkedCell = c.Address
.Display3DShading = False
End With
Next
End Sub