ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Cell interior color (https://www.excelbanter.com/excel-discussion-misc-queries/114025-cell-interior-color.html)

JohnB

Cell interior color
 
How do change a cell's interior color when a first gets the focus and when it
losses the focus. In other words when I first click on a cell is changes
color and when I click elsewhere it change color.

TIA
johnb

CLR

Cell interior color
 
Whenever a cell is Active, it is empahsized. In XL97 it simply puts a heavy
border around the cell, in newer versions it may enphasize by some other
method. When you "click-off" that cell to another cell, the emphasis
follows. If you wish to permanently color a cell, then highlight it and do
Right-click FormatCells Patterns and choose a color..........or, you
can also color cells by using the ConditionalFormat feature...........

hth
Vaya con Dios,
Chuck, CABGx3



"johnb" wrote:

How do change a cell's interior color when a first gets the focus and when it
losses the focus. In other words when I first click on a cell is changes
color and when I click elsewhere it change color.

TIA
johnb


Roger Govier

Cell interior color
 
Hi John


One way

You can use FormatConditional Formattinguse dropdown for Formula Is
=(ROW()=CELL("Row"))
or
=(COLUMN() = CELL("Col"))
set Format to whatever you wish

In order for this to operate, it will need a sheet event to force a
Calculate, otherwise the changes won't occur

Right click on the sheet tab and choose View Code
Copy and Paste the code blow into the sheet code area. Change Sheet
number to whatever Sheet you are using, I happened to be using Sheet3

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet3.Calculate
End Sub


--
Regards

Roger Govier


"johnb" wrote in message
...
How do change a cell's interior color when a first gets the focus and
when it
losses the focus. In other words when I first click on a cell is
changes
color and when I click elsewhere it change color.

TIA
johnb




JohnB

Cell interior color
 
Thanks Roger

Will try that.

"Roger Govier" wrote:

Hi John


One way

You can use FormatConditional Formattinguse dropdown for Formula Is
=(ROW()=CELL("Row"))
or
=(COLUMN() = CELL("Col"))
set Format to whatever you wish

In order for this to operate, it will need a sheet event to force a
Calculate, otherwise the changes won't occur

Right click on the sheet tab and choose View Code
Copy and Paste the code blow into the sheet code area. Change Sheet
number to whatever Sheet you are using, I happened to be using Sheet3

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Sheet3.Calculate
End Sub


--
Regards

Roger Govier


"johnb" wrote in message
...
How do change a cell's interior color when a first gets the focus and
when it
losses the focus. In other words when I first click on a cell is
changes
color and when I click elsewhere it change color.

TIA
johnb





Gord Dibben

Cell interior color
 
John

You could download Chip Pearson's ROWLINER add-in from

http://www.cpearson.com/excel/RowLiner.htm

Or use event code

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static OldCell As Range
If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
End If
Target.Interior.ColorIndex = 3
Set OldCell = Target
End Sub

Note: this is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste into that module.

If not what you're looking for, post back.


Gord Dibben MS Excel MVP

On Thu, 12 Oct 2006 03:13:02 -0700, johnb
wrote:

How do change a cell's interior color when a first gets the focus and when it
losses the focus. In other words when I first click on a cell is changes
color and when I click elsewhere it change color.

TIA
johnb


Gord Dibben MS Excel MVP


All times are GMT +1. The time now is 05:37 PM.

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