Solved

Code Not HIghlighting Rows properly

Posted on 2014-01-21
3
304 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
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.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

932 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

10 Experts available now in Live!

Get 1:1 Help Now