Hi Joseph
May be this could do?
Right-click on worksheet tab, choose View Code and paste the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address < "$A$1" Then Exit Sub
If Target.Value = "" Then
Target.Value = "X"
Else: Target.Value = "": End If
End Sub
PS: this will only work when the cell is actually selected (either with left
click from mouse or with keyboard arrow)
HTH
Cordially
Pascal
"Jolly Rogers" a écrit dans le message de news:
TzJRd.20157$Zr.9346@okepread03...
Can anyone suggest a good macro to allow me to select (touch) any cell in
a given range, and have the alpha character "X" (capitalized) appear in
the cell when the cell is selected?
For example, let's consider cell A1. A1 is initially blank and void of
any formulas. If I select A1 with my mouse, I want "X" to appear in A1.
If I select A1 again, I want X to disappear from A1, and so forth and so
on.
(Note: For my purposes, I prefer not to use a checkbox or radio buttons
because I already have conditional formatting depending on the contents of
the cells which will either have X or not.)
Thanks much!
Joseph
|