Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

Code Not HIghlighting Rows properly

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
leezac
Asked:
leezac
1 Solution
 
COACHMAN99Commented:
why not conditional format?
also try Range("N" & x).Value <> "")
0
 
Saqib Husain, SyedEngineerCommented:
This will not highlight the row which has "None" in column N
0
 
leezacAuthor Commented:
I checked and am taking the color coding out.  Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now