I have a small script that creates a checkbox in the selected cells.
I would like to have the checkbox always in the middle of my cell and have this even if I change the cell format.
What can I add as arguments to have this? (in the above, this worked for a few cells for me but I always have to fool around to have it correct for the cells I want my checkboxes in)
Thanks
VBA Code:
Sub addcheckboxes()
Dim cb As Object
Dim cell As Range
For Each cell In Selection
Set cb = ActiveSheet.CheckBoxes.Add(cell.Left + 5, cell.Top - 1, 20, 14.4)
cb.Caption = ""
cb.LinkedCell = cell.Address
cell.NumberFormat = ";;;"
Next cell
End Sub
I would like to have the checkbox always in the middle of my cell and have this even if I change the cell format.
What can I add as arguments to have this? (in the above, this worked for a few cells for me but I always have to fool around to have it correct for the cells I want my checkboxes in)
Thanks