Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Filling a Cell with Yellow backgound after testing for -ve cell d

In my worksheet "Major MACD Sep'09" I have calculated positive or negative
price variance data (format +/- $$.cc) from Row 5 down in each alternate
Column from C through BI (ie Column C,E,G,I etc to BI).
After the latest entry in any Column there is always the value 0.00.
I need to find any criteria where the last three price variation entries
before the 0.00 value are all negative and if this test is met I need to fill
Row 3 of that particular Column with a yellow background in order to
highlight the situation.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Filling a Cell with Yellow backgound after testing for -ve cell d

Hi Chris


Try the below..which will work on the active sheet. The below will check
only row3...Adjust to suit..

Sub Macro()
Dim lngCol As Long, intCount As Integer
Range("B3").Interior.ColorIndex = xlNone
For lngCol = Range("BI3").Column To Range("C3").Column Step -2
If Cells(3, lngCol) < 0 Then intCount = intCount + 1 Else intCount = 0
If intCount = 3 Then Range("B3").Interior.ColorIndex = 6: Exit For
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Chris Maddogz" wrote:

In my worksheet "Major MACD Sep'09" I have calculated positive or negative
price variance data (format +/- $$.cc) from Row 5 down in each alternate
Column from C through BI (ie Column C,E,G,I etc to BI).
After the latest entry in any Column there is always the value 0.00.
I need to find any criteria where the last three price variation entries
before the 0.00 value are all negative and if this test is met I need to fill
Row 3 of that particular Column with a yellow background in order to
highlight the situation.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Filling a Cell with Yellow backgound after testing for -ve ce

Thanks again Jacob works fine

"Jacob Skaria" wrote:

Hi Chris


Try the below..which will work on the active sheet. The below will check
only row3...Adjust to suit..

Sub Macro()
Dim lngCol As Long, intCount As Integer
Range("B3").Interior.ColorIndex = xlNone
For lngCol = Range("BI3").Column To Range("C3").Column Step -2
If Cells(3, lngCol) < 0 Then intCount = intCount + 1 Else intCount = 0
If intCount = 3 Then Range("B3").Interior.ColorIndex = 6: Exit For
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Chris Maddogz" wrote:

In my worksheet "Major MACD Sep'09" I have calculated positive or negative
price variance data (format +/- $$.cc) from Row 5 down in each alternate
Column from C through BI (ie Column C,E,G,I etc to BI).
After the latest entry in any Column there is always the value 0.00.
I need to find any criteria where the last three price variation entries
before the 0.00 value are all negative and if this test is met I need to fill
Row 3 of that particular Column with a yellow background in order to
highlight the situation.

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
Copy cell backgound color to another cell John Excel Programming 1 February 6th 09 01:44 PM
Yellow pop-up message in cell Brw Excel Discussion (Misc queries) 2 December 21st 05 03:02 PM
formula for if Cell c1 is yellow shaded cell d1 should be yellow Hardeep Excel Discussion (Misc queries) 1 October 27th 05 02:58 PM
IF the cell is yellow... Connie Martin Excel Discussion (Misc queries) 7 July 28th 05 07:35 PM
Value of a cell in a range if color is yellow Dominique Feteau Excel Programming 1 January 9th 04 10:57 PM


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

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"