+ Reply to Thread
Results 1 to 9 of 9

Comparing Value

  1. #1
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Comparing Value

    Hi All,

    Is this possible to compare two set rows and produce high the cells with colors.

    Like Am having Excel with set of values:

    A1 -A20 I have random Values.And B1- B20 I have random Values..The Macro should compare the B1 -B20 Cell values to A1-A20(Respective cells) and Make colors in the Brow if the B cell Values <> 5% of A cells value..


    Any help greatly appreciated...

    Thanks,
    Lakshmanan

  2. #2
    Forum Contributor
    Join Date
    04-25-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: Comparing Value

    Hi,

    Try this:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Comparing Value

    Hi djdjdj,

    Thanks for the response.Here i have attached my original Requirement sheet.Here I tried with your code ..But am failing..Here I need to compare the X2 Values with X1,X3 Value with X2,X4 value with X3..like wise till end i need to compare..

    When comparing X2 with X1 the macro should populate the color based on the below condition.

    IF X2 = X1 (No need of color change)
    IF X2 > 5% of X1 (Need to generate Red Color)
    IF X2< 5% of X1 (Need to Generate Yellow color)


    Like wise for Others till X7:

    IF X3 = X2 (No need of color change)
    IF X3 > 5% of X2 (Need to generate Red Color)
    IF X3< 5% of X2 (Need to Generate Yellow color)


    Thanks in advance,
    Lakshmanan
    Attached Files Attached Files

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Comparing Value

    Try this code to see if this works as per your requirement.
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Comparing Value

    Hi Sktneer,

    Thats awesome..It is working fine.One more query.If i have more number of sheet which having what should i do?..I have tried and it is working for the current sheet.Pls find the attached sheet for you reference....
    Attached Files Attached Files

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Comparing Value

    Though the code will run successfully on any sheet irrespective of sheet name but if you want to run the code on each sheet automatically in one go, try this code......
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Comparing Value

    You are always great sktneer..Thanks..Its perfect.After populating color coding i want to refresh the data's in all the sheet.So shall i use the clear or refresh function here along with this code..

    Thanks,
    Lakshmanan
    Last edited by laxmanann; 04-16-2014 at 01:40 AM.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Comparing Value

    Glad to help you. Thanks for the feedback.
    I have no idea about refreshing the data in the sheet. You can try control+alt+F9 which forces a complete refresh.
    If that takes care of your question, please mark your thread as solved.
    Moreover you may also click on * (star) to Add Reputation to those who have put their time and efforts to help you in this forum. This is another way to say thanks to them.

  9. #9
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Comparing Value

    Hi Sktneer,

    control+alt+F9 is not refreshing datas.But no pbm for me..Thanks for your help and you spent your valuable time for me..Im mark it as solved now..

    Laxmanan

+ 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. Comparing
    By welchs101 in forum Excel General
    Replies: 5
    Last Post: 07-03-2012, 07:24 PM
  2. Comparing two columns
    By rg1210 in forum Excel General
    Replies: 2
    Last Post: 10-27-2011, 11:59 PM
  3. comparing-What I wish to do
    By kchris in forum Excel General
    Replies: 2
    Last Post: 02-28-2007, 03:03 PM
  4. comparing
    By popop in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-13-2006, 08:34 AM
  5. Comparing two spreadsheets
    By Morten in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2005, 09:30 AM

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