Automatically input a symbol in a selected cell

  • Thread starter Thread starter mapesii
  • Start date Start date
M

mapesii

I have a range of cells that when a cell is selected can a symbol be input in
that cell? and if selected again remove the symbol. Can this bee done?
 
Try something like this

It goes into the worksheet module, when you right click on the range
A1:A10 a check mark will appear or be removed from the selected cell.

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel
As Boolean)
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Cancel = True
If Target <> "a" Then
With Target.Font
.Name = "Webdings"
End With
Target.FormulaR1C1 = "a"
Else: Target = ""
End If
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top