View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Shane Devenshire[_2_] Shane Devenshire[_2_] is offline
external usenet poster
 
Posts: 3,346
Default Change color fill when data in cell changes

Hi,

And if the cell is already yellow what do you want to do? Where are the
cell you want this to happen to, what sheet, what range?

Hi,

Here is some sample code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim isect As Range
Set isect = Application.Intersect(Target, Range("A1:A10"))
If Not isect Is Nothing Then
Target.Interior.ColorIndex = 6
End If
End Sub

1. To add this code to your file, press Alt+F11,
2. In the VBAProject window, top left side, find your sheet name under your
file name and double click it.
3. Paste in or type the code above.

The will work on the range A1:A10 in the activesheet.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Cali Sal" wrote:

Thanks, but I know how to change the color of the cell manually. What I'd
like is: when I change the data in the cell, the color fill changes to yellow
(for example).

The purpose is: I have 100 rows of data, when I update the excel (which I do
monthly) I what the updated cells to change color. Is this possible?

"default105" wrote:

patterns after you click the format button
--
Pete Blackburn - words to live by:
"Don''t ever let somebody tell you. You can''t do something.You got a
dream,You gotta protect it." Edited Quote from the Pursuit Of Happiness








"Cali Sal" wrote:

I'd like the cell color to change when I change the data in the cell (sort of
checking off that I've updated a cell), can I do this using conditional
formatting?