Turning Cell into Checkbox

L

lorenodonnell

Does anyone know a simple way of converting a cell into a checkbox
format in an excel spreadsheet?
 
B

Bill (Unique as my name)

Maybe not what you're looking for, but . . .
You can add a checkbox on top of the cell and link the cell to the
checkbox.
 
D

davesexcel

copy this entire code in a module,
highlite where you want the checkbox and run the macro
when you click on the cell a check mark will appear
only problem is, you can't enter text in the box because the webdings
font is what creats the check mark
Dave



Sub AddCheckboxesMarlett()
On Error Resume Next
Dim c As Range, myRange As Range
Set c = ActiveCell
Set myRange = Selection
For Each c In myRange
With c
FormatConditions.Delete
FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual,
_
Formula1:="=""a"""
FormatConditions(1).Interior.ColorIndex = 6
Font.Name = "Marlett"
End With
ActiveSheet.Shapes.AddShape(msoShapeRectangle, c.Left, c.Top,
c.Width, c.Height).Select
With Selection
ShapeRange.Fill.Visible = msoFalse
Name = c.Address
OnAction = "ToggleCheckbox"
End With
Next
myRange.Select
End Sub

Sub ToggleCheckbox()
On Error Resume Next
Dim shp As String
shp = Application.Caller
If Range(shp).Value = "a" Then Range(shp).Value = "" Else
Range(shp).Value = "a"
End Sub
 
Top