Solved

Code Not HIghlighting Rows properly

Posted on 2014-01-21
3
338 Views
Last Modified: 2014-01-21
I did not write this code.  It is meant to highlight every row if cell in Column P is not null.
It is only hightlighting some rows.  It highlighted a row with (77.01) but did not highlight one with 50.05.
I need for it to highlighted rows where cells in column P are not null.  Thanks in advance.  Using Excel 2010 also.

Dim x As Long
        For x = 11 To row - 1
            If (Range("P" & x).Value > 0.05 Or Range("P" & x).Value < -0.05) And (Range("N" & x).Value <> "None") Then
                With Range(x & ":" & x).Interior
                    .Pattern = xlSolid
                    .PatternColorIndex = xlAutomatic
                    .Color = 65535
                    .TintAndShade = 0
                    .PatternTintAndShade = 0
                End With
            End If
        Next
    End If
0
Comment
Question by:leezac
3 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39797970
why not conditional format?
also try Range("N" & x).Value <> "")
0
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 39798022
This will not highlight the row which has "None" in column N
0
 

Author Closing Comment

by:leezac
ID: 39798050
I checked and am taking the color coding out.  Thanks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This collection of functions covers all the normal rounding methods of just about any numeric value.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question