LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Conditional Format - Identifying Highlighted Cells

A brief explanation:
I have 3 columns of data: X, Y, and Z. User inputs a high/low ranger
(i.e. 4 +3/-2, i.e. 2 to 7). If the number is outside of that range,
I have used conditional format to set the cell color to gray.

Now here's where I have a problem.
I'm attempting to add a fourth column, OK/NG column. If either of the
X, Y, or Z cells in a row are gray, then the fourth box also turns
gray and displays NG. Otherwise it will display OK (i.e. all XYZ
points are within spec).

I did a little test myself, and it seems as though the code below
works if you change the cell interior color on the excel spreadsheet,
but when the cell color is changed due to conditional formatting, the
macro reads the cell as a normal cell and displays OK for all entries.


For RowCounter = 1 to 10

If Sheets("Sheet1").Cells(RowCounter, 1).Interior.Pattern = xlSolid
Then
Sheets("Sheet1").Cells(RowCounter, 2).Value = "NG"
With Sheets("Sheet1").Cells(RowCounter, 2).Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
Else
Sheets("Sheet1").Cells(RowCounter, 2).Value = "OK"
End If

Next RowCounter

------

Anybody else encountered this problem? Any way I can properly
identify a colored cell from conditional format in the macro?

Thanks. NP


 
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
Identifying cells that add up to a certain amount Hifi Excel Worksheet Functions 5 June 3rd 08 07:20 PM
Identifying updated cells MLK Excel Worksheet Functions 2 January 10th 07 07:47 PM
Identifying adjacent cells daddioja Excel Worksheet Functions 5 June 2nd 06 08:56 PM
Identifying #N/A cells Lee Harris Excel Worksheet Functions 1 November 18th 05 02:57 AM
Identifying Cells with formulas VETcalc Excel Worksheet Functions 2 August 13th 05 06:49 AM


All times are GMT +1. The time now is 02:46 PM.

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

About Us

"It's about Microsoft Excel"