2011-06-30, 02:18 AM
I found this script with a macro that automatically does part of it if I assign it to a key
Using this, I get stuck with the true/false linked to the same cell. I'd like for it to be in a parallel cell to the right. Anyone good with Visual Basic that could change that for me?
Code:
Sub AddCheckBoxes()
On Error Resume Next
Dim c As Range, myRange As Range
Set myRange = Selection
For Each c In myRange.Cells
ActiveSheet.CheckBoxes.Add(c.Left, c.Top, c.Width, c.Height).Select
With Selection
.LinkedCell = c.Address
.Characters.Text = ""
.Name = c.Address
End With
c.Select
With Selection
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, _
Formula1:="=" & c.Address & "=TRUE"
.FormatConditions(1).Font.ColorIndex = 6 'change for other color when ticked
.FormatConditions(1).Interior.ColorIndex = 6 'change for other color when ticked
.Font.ColorIndex = 2 'cell background color = White
End With
Next
myRange.Select
End SubUsing this, I get stuck with the true/false linked to the same cell. I'd like for it to be in a parallel cell to the right. Anyone good with Visual Basic that could change that for me?

