ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Coloring Active Cell (https://www.excelbanter.com/excel-worksheet-functions/47400-coloring-active-cell.html)

Carroll

Coloring Active Cell
 
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 Guillett


Don't think possible but right click sheet tabview codeinsert thisSAVE
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

--
Don Guillett
SalesAid Software

"Carroll" wrote in message
oups.com...
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




Carroll

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


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 Guillett

Suggest you RE-read my post about not changing previous cells.

--
Don Guillett
SalesAid Software

"Carroll" wrote in message
ups.com...
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




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


Don Guillett

What is it that you really want to do?? Be VERY clear

--
Don Guillett
SalesAid Software

"Carroll" wrote in message
oups.com...
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




Don Guillett

You could change it to a doubleclick or right clickevent instead

--
Don Guillett
SalesAid Software

"Carroll" wrote in message
oups.com...
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




Carroll

Thanks.



All times are GMT +1. The time now is 02:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com