Solved

Code Not HIghlighting Rows properly

Posted on 2014-01-21
3
302 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
Comment Utility
why not conditional format?
also try Range("N" & x).Value <> "")
0
 
LVL 43

Accepted Solution

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

Author Closing Comment

by:leezac
Comment Utility
I checked and am taking the color coding out.  Thanks.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now