Starstopper31
New Member
- Joined
- Jan 19, 2015
- Messages
- 8
I am fairly new to macros/VBA, although I am learning enough to be dangerous. I currently am using the code listed below to create checkboxes when the user clicks a cell within the defined range. I set the font of each cell within the range to "Wingdings", and when the user clicks on the cell, a check appears in the cell. It works well, but the actual document I have has several different areas where a checkbox will be needed. On top of that, there is a possibility that the form will become dynamic, so I am trying to avoid having a specific range where the code is applied. I would prefer to have the code work for all cells within the sheet where "Wingdings" is the font. Is something like that possible? Can someone offer me a suggestion for how I could alter it? I have been trying on and off for a few days and I keep getting errors. Any help would be appreciated. Thanks!
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Application.EnableEvents = False
If Target.Cells.Count = 1 Then
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Select Case Target.Value
Case ""
Target.Value = "ü"
Case "+"
Target.Value = ""
Case Else
Target.Value = ""
End Select
End If
End If
Application.EnableEvents = True
End Sub