I have a doubleclick macro that works nicely on one sheet, but with a slight change, is not working well on another sheet.
The code that isn't working well is below:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
If Target.Font.ColorIndex <> 1 Then
'not black? -> set to black
Target.Cells.Font.ColorIndex = 1
Else
'black? -> set to magenta
Target.Cells.Font.ColorIndex = 7
End If
Cancel = True
End Sub
The code on another sheet that works well has one small difference.
Instead of .Cells I have .EntireRow.
The code on the first sheet will change the font in the active cell from black to magenta or the reverse, however I must doubleclick _twice before it takes effects.
I only need to doubleclick once on the other sheet with the .EntireRow code.
Is there something I can change to make the code work right away for the first sheet?
TIA
Bookmarks