PDA

View Full Version : Solved: How to reset only the current row color?



nousername
03-19-2008, 04:01 AM
I want the user to be able to doubleclick on any cell on a given row and reset the color of that row to white (O), but only if the color of that row is grey (15) and the font is not bold. My currnet worksheet has values in columns A-F on each row, so the code should only work if the user doubleclick in a cell in one of the columns that meets the requirements.

Can anyone help me solve this issue?

Bob Phillips
03-19-2008, 04:14 AM
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range("A:F")) Is Nothing Then
With Target

If Target.Interior.ColorIndex = 15 And Target.Font.Bold Then

Target.EntireRow.Interior.ColorIndex = xlColorIndexNone
End If
End With
End If

ws_exit:
Application.EnableEvents = True

End Sub

nousername
03-19-2008, 04:24 AM
Xld,

Thanks your code worked!

Nousername