Change Color In Cell On Click 2

  • Thread starter Thread starter Ange Kappas
  • Start date Start date
A

Ange Kappas

Thanks Bob that works great, just one more detail since I didn't notice it
at first, What code would you put in to return the cell color back to white
on click again.
I would use that if I clicked a wrong cell.

Thanks
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Const WS_RANGE As String = "A1:I10"

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
If Target.Interior.ColorIndex = 6 Then
Target.Interior.ColorIndex = xlColorIndexNone
Else
Target.Interior.ColorIndex = 6
End If
End If
End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top