+ Reply to Thread
Results 1 to 11 of 11

Match Positive and Negatives then Highlight

  1. #1
    Forum Contributor
    Join Date
    08-18-2009
    Location
    Chih, Mexico
    MS-Off Ver
    Excel 2010
    Posts
    102

    Post Match Positive and Negatives then Highlight

    Hi, everyone

    I need your help to highlight cells in column with positive and negative numbers that are equals and highlight those cells then sort up cells that doesn't have color

    Example:

    100 <----highlight
    105
    -103
    120 <----highlight
    -100 <----highlight
    110
    -120 <----highlight

    Will preciate your help!!!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Match Positive and Negatives then Highlight

    Hi there.
    I guess it's the middle of the night for you!!

    I think you need to explain your problem a bit more clearly. can you post an example sheet - showing sme date, showing some cells that should be highlighted and showing WHY those particular cells should be highlighted.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Match Positive and Negatives then Highlight

    if i understood you correctly....

    this might work?
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor ANDREAAS's Avatar
    Join Date
    05-06-2013
    Location
    Port Elizabeth, South Africa
    MS-Off Ver
    Excel 2007 / 2010
    Posts
    368

    Re: Match Positive and Negatives then Highlight

    or without code....
    conditional formatting,duplicate values and then filter by cell color....

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Match Positive and Negatives then Highlight

    as an option..

    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Match Positive and Negatives then Highlight

    Make headers in row 1

    B2=ABS(A2)
    C2=countif($B$2:$B$8,B2)

    and drag down, both formula's

    Then filter on c1 on criteria 1.

    Then you have non duplicated cells.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  7. #7
    Forum Contributor
    Join Date
    08-18-2009
    Location
    Chih, Mexico
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Match Positive and Negatives then Highlight

    ok, my bad here's the sample file with mid and final result that i want achieve, the mainly target it's to match and highlight positive and negative numbers..
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Match Positive and Negatives then Highlight

    Quote Originally Posted by werko View Post
    ok, my bad here's the sample file with mid and final result that i want achieve, the mainly target it's to match and highlight positive and negative numbers..
    I had a look at your workbook and you appear to write your negative numbers in a somewhat unusual way.

    That confuses the VBA and it seems it may confuse you too.

    I tried the below code on your data. This should color cyan all values that pair with their negative. However it only colors in cyan some of your green pairs.

    Note the red line where -(value) is used as negative notation.

    But if then run again with (value)- as the negative notation (as in commented blue line) it then picks up the rest, including a couple of pairs that you didn't color green. i.e. (12451 and 12451-), and (7998- and 7998).

    Now, I don't know, and don't really want to know, why your method (visual inspection or other) didn't pick up those pairs. But I do think you should use a negative notation that the VBA consistently recognizes, specifically the standard Excel negative notation.

    My code, run twice, second time with the notational change, does appear to pick up all pos/neg pairs according to your notation, including the ones you missed, but that's not an approach that I'd personally be happy with.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    08-18-2009
    Location
    Chih, Mexico
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Match Positive and Negatives then Highlight

    well i think that the codes will not work, first time that the codes that you provide dont work....

  10. #10
    Forum Contributor
    Join Date
    08-18-2009
    Location
    Chih, Mexico
    MS-Off Ver
    Excel 2010
    Posts
    102

    Re: Match Positive and Negatives then Highlight

    Wait the code from Fotis1991 it seems to work a little as he said as an option...
    maybe wth some work it will work...

  11. #11
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Match Positive and Negatives then Highlight

    Quote Originally Posted by werko View Post
    well i think that the codes will not work, first time that the codes that you provide dont work....
    The code I posted worked well for me when tested on your data, subject to the other comments I made regarding how your "negative" is defined.

    Usually, rather more explanation as to why a code "will not work" is useful to all readers.
    What does it do that it shouldn't? What doesn't it do? What happens when you tried to run it?

    If you like you can use the simple dataset - 5 pos/neg values down columnA - to test the fotis code
    2
    -2
    5
    -2
    2

    I wish you well!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 11-21-2012, 07:27 AM
  2. [SOLVED] Adding Positive and Negatives
    By Jflann1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-18-2012, 04:23 PM
  3. Sum Negatives into next Positive
    By ScooterNM5 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-05-2010, 07:01 AM
  4. Converting inputted negatives to positive #'s
    By JMRamsey in forum Excel General
    Replies: 4
    Last Post: 06-14-2007, 04:00 PM
  5. I need to change positive values to negatives
    By lancekeith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2006, 02:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1