Hello all,
I am interested in creating a code that creates checkboxes in pre-selected cells, also aligning them in the center horizontally and vertically, and also offsetting the TRUE/FALSE value away from these cells
So far i have found something but it will not center the checkboxes
Any help will be greatly appreciated
I am interested in creating a code that creates checkboxes in pre-selected cells, also aligning them in the center horizontally and vertically, and also offsetting the TRUE/FALSE value away from these cells
So far i have found something but it will not center the checkboxes
Any help will be greatly appreciated
Code:
Sub CellCheckbox()Dim myCell As Range, myRng As Range
Dim CBX As CheckBox
For Each myCell In Selection
With myCell
Set CBX = .Parent.CheckBoxes.Add( _
Top:=.Top, _
Left:=.Left, _
Width:=1, _
Height:=1)
CBX.Name = .Address(0, 0)
CBX.Caption = ""
CBX.Left = .Left + ((.Width - CBX.Width) / 2)
CBX.Top = .Top + ((.Height - CBX.Height) / 2)
CBX.LinkedCell = .Offset(0, 15).Address(external:=True)
CBX.Value = xlOff
End With
Next myCell
End Sub