Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Value = "" Then Target.Value = 1: GoTo fin
If Target.Value = 1 Then Target.Value = 2: GoTo fin
If Target.Value = 2 Then Target.Value = ""
fin:
Cancel = True
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim Nb()
Nb = Array(1, 2, "")
On Error GoTo fin
Target.Value = Nb(Application.WorksheetFunction.Match(Target.Value, Nb, 0) Mod 3)
Cancel = True
Exit Sub
fin:
Target.Value = Nb(0)
Cancel = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Target.Value = Choose(Target.Value Mod 3 + 1, 1, 2, Empty)
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Interior.ColorIndex <> 6 Or Target.Count > 1 Then Label1.Visible = False: Exit Sub
Target = Choose(Target Mod 3 + 1, 1, 2, Empty)
With Label1
.Caption = Target
.Top = Target.Top
.Left = Target.Left
.Width = Target.Width
.Height = Target.Height
.Visible = True
End With
End Sub
Private Sub Label1_Click()
Worksheet_SelectionChange ActiveCell
End Sub