+ Reply to Thread
Results 1 to 6 of 6

Loop and highlight differences

  1. #1
    Registered User
    Join Date
    11-08-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Unhappy Loop and highlight differences

    COl A Col B
    1 a1
    2 a1
    3 a1
    1 b1
    2 b2
    3 b3

    Can anyone help me to get a VB macro for this,

    1. Loop from 1 to 3
    2. check for any changes in name in col B.
    3. If the names are same do nothing ( eg: a1 is same in all 3 rows). Hence nothing to do.
    4.If the names are different, thn highlight them with any color( eg: b1, b2,b3 )

    Rgds,
    Rsh

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Loop and highlight differences

    Please Login or Register  to view this content.

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Loop and highlight differences

    Do you really need VBa for this? Why not conditional formatting?

    See this workbook.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    11-08-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Loop and highlight differences

    [QUOTE=Bob Phillips;2414414]

    Hi Bob,
    Thanks for your help. But if i modify the same code for my excel sheet which is in attachment it runs differently.

    1. Instead of 1 to 3 in column A, my excel sheet has 1 to 6 in col A.
    2. I have highlighted few rows whose assy numbers are different in col S

    Please help me in sorting this.
    Attached Files Attached Files

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Loop and highlight differences

    Why post a question asking to loop from 1 to 3 when you actually want from 1 to 6?

    You then show high-lighted rows in groups of 6, 7, and 8.....

    The last sequence of numbers is:=

    3
    4
    5
    6
    1
    2
    1
    2

    How do we recognise that as a group? ......

    I think you should organise your data a bit better if you are to get a solution to this problem.

  6. #6
    Registered User
    Join Date
    11-08-2010
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Loop and highlight differences

    Hi,
    This is what the task given to me from my boss. Even I was confused. But not sure whether we can be able to do this or not. So posted the same what i got from my boss, to know whether it is possible or not.

    Ok, Now if i put an auto filter and arrange them in ascending order i will get

    1
    1
    1
    2
    2
    2... Something like this.

    Is there a way to organize data like this and then highlight. I think it confuses much more.

    All details are in a word file in attachment which gives info, what need to be done
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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