Sub NewCheckbox() Dim lRow As Long Dim target As Range Dim obj As Object 'Adds a Forms toolbar checkbox to the cell 'Checkbox value is linked to that same cell, using a white font color With Worksheets("Input") lRow = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).Row 'find first empty row in database Set target = .Cells(lRow, 1) With .CheckBoxes.Add(target.Left, target.Top + 1, target.Width, target.Height - 1) .Caption = "Fakturer" .LinkedCell = target.Address .Name = "cb_" & target.Address(False, False) 'Name it like "cb_A11" .OnAction = "CheckboxClicked" End With target.Font.ColorIndex = 2 'White font color for linked cell TRUE/FALSE value target.Value = False End With End Sub
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: