+ Reply to Thread
Results 1 to 11 of 11

macro to compare a range with a standard range and highlight cells, when not matched

  1. #1
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    macro to compare a range with a standard range and highlight cells, when not matched

    Hi Gurus,

    I have a standard codes and regions in a sheet which is a standard format for all time use.

    i would be getting a report in which regions would be wrong for some of the codes.

    please help me with a macro which should compare my report with standard format and highlight regions (cells) which are wrong.


    I have attached a sample for the reference.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    You can Simply get it from Vlookup formula and you wont see any wrong entries

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    yes i can use the vlookup... but i will get a report to check and colour the wrong entry...pls help through a macro..

  4. #4
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    You wont get Wrong entry if you use above.... as False in Vlookup means exact match.....

  5. #5
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    i understand Mr. NAVEEN.

    i know to use vlookup for this scenario but what i am doing is a verification process in which i get a report and i need to compare that with standard report and highlight wrong values...hope u understood

  6. #6
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    Anyway, we have an Excellent Tool in Excel.. Macro recorder... just start recording and do Vlookup where you want result in excel and stop recording.... You have your macro......

  7. #7
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    hi Naveen,

    Here i dont want a exact match... i just need to color the wrong entry in the list compared with standard format....

  8. #8
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    Try this code, you need to change the code like adjust ranges and worksheet names....

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    Hi Naveen,

    i need a macro to just compare each code of my report with standard code and find whether right region is place.


    or else the region cell has to be highlighted..


    without vlookup, i need a macro

  10. #10
    Forum Contributor
    Join Date
    09-05-2012
    Location
    Dubai
    MS-Off Ver
    Office 365
    Posts
    409

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    Check attached...
    you can run macro using ALT +F8 from your excel
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    11-16-2014
    Location
    United States
    MS-Off Ver
    2010
    Posts
    204

    Re: macro to compare a range with a standard range and highlight cells, when not matched

    i have got a new idea by your macro. Thanks a lot.

+ 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. [SOLVED] How to highlight a range in a macro without replacing it with a range name such as C1:L15
    By Mary Mullen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2014, 04:14 PM
  2. [SOLVED] Define two range, compare values and then take action if matched
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2013, 11:55 PM
  3. [SOLVED] Highlight range of cells - run macro - select last cell in range
    By chromachem in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2012, 11:46 AM
  4. Macro to loop through all worksheets, pulling a range of cells if criteria matched.
    By strictlydiesel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2009, 12:37 AM
  5. Compare a selected Range with a Named range and select cells that do not exist
    By PCLIVE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2005, 03:05 PM

Tags for this Thread

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