+ Reply to Thread
Results 1 to 13 of 13

Macro To Compare Sheets and Highlight Common

  1. #1
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Macro To Compare Sheets and Highlight Common

    Hello,
    I use the below to highlight similar between two sheets,

    Please Login or Register  to view this content.
    I would like to compare on more than two sheets, and the amount of sheets may vary. Can someone please help in allowing the code to expand over many sheets.

    Thank you

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro To Compare Sheets and Highlight Common

    Quote Originally Posted by gaspower View Post

    I would like to compare on more than two sheets, and the amount of sheets may vary. Can someone please help in allowing the code to expand over many sheets.

    Thank you
    This will compare Sheet1 to all other sheets in the same workbook.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Macro To Compare Sheets and Highlight Common

    Hello,
    thank you for the reply. I ran the macro, but none of the cells in column "A" highlighted green.

    Thank you

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro To Compare Sheets and Highlight Common

    It works for me. Did you change the code? Where did you paste the code? Do you have more than one workbook open?

  5. #5
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Macro To Compare Sheets and Highlight Common

    Note this has been cross-posted here.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  6. #6
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Macro To Compare Sheets and Highlight Common

    Hello,
    I changed the code where you right click on the sheet and post the post and initiate by alt F8. I only have one workbook open with nine sheets. Column "A" on all sheets is the master. Just to verify, does it matter how many columns each sheet has filled?

    Thank you

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Macro To Compare Sheets and Highlight Common

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No help to be offered until the link is provided.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Macro To Compare Sheets and Highlight Common


  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Macro To Compare Sheets and Highlight Common

    Thank you.

  10. #10
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Macro To Compare Sheets and Highlight Common

    Hello,

    Welcome and sorry for the confusion..

  11. #11
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Macro To Compare Sheets and Highlight Common

    Quote Originally Posted by gaspower View Post
    Hello,
    I changed the code where you right click on the sheet and post the post and initiate by alt F8. I only have one workbook open with nine sheets. Column "A" on all sheets is the master. Just to verify, does it matter how many columns each sheet has filled?

    Thank you
    It does not matter how many columns each sheet has, but the code only looks for matches in column A. And to restate; it compares Sheet1 to all other sheets.

    The code should go into a standard code module e.g. Module1.

  12. #12
    Forum Contributor
    Join Date
    07-15-2007
    Location
    Bend, Oregon
    MS-Off Ver
    Office 2016 Windows
    Posts
    156

    Re: Macro To Compare Sheets and Highlight Common

    Thank you very much. It works perfect.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Macro To Compare Sheets and Highlight Common

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Compare Two Sheets and Highlight Common Items
    By farhadj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-06-2019, 09:06 AM
  2. Compare Value and Highlight which is not Most Common Value
    By Rajeshkumar R in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-05-2018, 12:29 AM
  3. [SOLVED] vba - compare 2 columns highlight data not common to both
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2014, 06:00 AM
  4. Macro that can compare sheets between 2 workbooks, highlight the difference
    By jeffboy29 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-19-2013, 11:31 AM
  5. Macro To Compare Multiple Excel sheets and highlight duplicates
    By Rey123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2013, 05:07 AM
  6. Replies: 9
    Last Post: 04-18-2013, 03:54 PM
  7. macro to compare columns and highlight common rows
    By jagman1990 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-22-2010, 12:27 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