I have a vba code which works well up to a point, the code i'm using is as follows
Private Sub Worksheet_BeforeDoubleclick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range("$L$3:$L$187")) Is Nothing Then Exit Sub
Select Case Target
Case ""
Target = "CHECKED"
Target.Interior.ColorIndex = 4
Case Else
Target = "NOT CHECKED"
Target.Interior.ColorIndex = 3
End Select
Cancel = True
End Sub
the code works until i doubleclick a cell in error, for example
if i doubleclick cell L5 it will insert the phrase "CHECKED" and turn green as requested, if however I have clicked on it in error and i then doubleclick it again it will enter the phrase "NOT CHECKED" and turn red as requested, however when I have completed the necessary checks and the return to the cell L5 and doubleclick on it it will do nothing and won't enter the "checked" phrase.
can anyone suggets a solution
Many thanks
Rob
Private Sub Worksheet_BeforeDoubleclick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range("$L$3:$L$187")) Is Nothing Then Exit Sub
Select Case Target
Case ""
Target = "CHECKED"
Target.Interior.ColorIndex = 4
Case Else
Target = "NOT CHECKED"
Target.Interior.ColorIndex = 3
End Select
Cancel = True
End Sub
the code works until i doubleclick a cell in error, for example
if i doubleclick cell L5 it will insert the phrase "CHECKED" and turn green as requested, if however I have clicked on it in error and i then doubleclick it again it will enter the phrase "NOT CHECKED" and turn red as requested, however when I have completed the necessary checks and the return to the cell L5 and doubleclick on it it will do nothing and won't enter the "checked" phrase.
can anyone suggets a solution
Many thanks
Rob