Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default cell color macro doesn't work

I have this macro that I have been trying to use to change the cell colors of
the cells when the value inside it changes.

Private Sub Worksheet_change(ByVal Target As Range)
If Not Application.Intersect(Range("G4:G17"), Target) Is Nothing Then
If Target.Value 0 Then
Target.Cells.Interior.ColorIndex = 35
ElseIf Target.Value < 0 Then
Target.Cells.Interior.ColorIndex = 38
Else
Target.Cells.Interior.ColorIndex = xlNone
End If
End If
End Sub

I can't understand why it wouldn't work. The only things that I can think
might be affecting it is: 1, the cells are linked to other cells in the sheet
which are linked to an outside program. 2, I don't know if this code
translates to each individual cell color changing as the value changes or if
it wants to change the range when a cell changes . . . anyway, thanks for
any help you can give me.

-DMS


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default cell color macro doesn't work


Hello Darren,

It seems that you should not bother with an event macro ... since
conditional formatting could easily do the job ...

HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default cell color macro doesn't work

Wow,

Amazingly simple, Thanks for the help.

-Darren

"Carim" wrote:


Hello Darren,

It seems that you should not bother with an event macro ... since
conditional formatting could easily do the job ...

HTH
Cheers
Carim


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make text color match cell color with macro? JoeSpareBedroom Excel Discussion (Misc queries) 1 June 26th 07 07:09 PM
I moved a file from work to home and now my color macro does not w nick s Excel Worksheet Functions 2 December 3rd 05 02:39 PM
back ground color doesn't work in cell. Soother Excel Worksheet Functions 1 October 7th 05 02:14 AM
My fill color and font color do not work in Excel Std Edition 2003 chapstick Excel Discussion (Misc queries) 1 September 11th 05 08:48 PM
color filled cell invisible on work screen chances_r Excel Worksheet Functions 1 May 25th 05 01:52 AM


All times are GMT +1. The time now is 12:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"