Consulting

Results 1 to 3 of 3

Thread: Solved: How to reset only the current row color?

  1. #1

    Solved: How to reset only the current row color?

    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?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    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
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Xld,

    Thanks your code worked!

    Nousername

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •