Coloring Active Cell

  • Thread starter Thread starter Carroll
  • Start date Start date
C

Carroll

Hello,

Is there a function I could use with Conditional Formatting that would
allow me to color a cell if it was the active cell? I know I could
probably do this in VBA, but I would be interested in a method that
used Condtional Formatting.


Thanks,

Carroll Rinehart
 
Don't think possible but right click sheet tab>view code>insert this>SAVE
If you want to keep the highlighting for past selections delete the cells
line

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = 0
Target.Interior.ColorIndex = 6
End Sub
 
Thanks Don. I was interested in returning the previously active cell
to its original state. One reason I was interested in sticking to
strictly conditional code was that I have other conditional formatting
already in place, and I have read that the VBA approach wipes out
whatever conditional formatting you have in place.

Carroll
 
Don,

After some testing with the VBA code you provided, I notice that my
underlying conditional formatting did actually stay intact. However
what was weird was that all cells that I had colored previously all
turned white as soon as I move just one cell over.

I like your code and will keep it for another situation, but does
anyone know how to do this with conditional formatting? I did look at
the cell function, but I didn't see how I could use that with
conditional formatting to color the active cell.

Thanks,

Carroll
 
Don,

I agree that if I comment out the cells line in the VBA that it will
not remove the coloring from cells that I purposefully had already
colored, but then I end up with a trail of yellow wherever my cursor
goes.

Your code is great where you have a sheet with cells all the same
color.

Thanks,

Carroll
 
You could change it to a doubleclick or right clickevent instead
 

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