+ Reply to Thread
Results 1 to 10 of 10

Paint cell if data change

  1. #1
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2010
    Posts
    230

    Paint cell if data change

    I have a table with data where I want to paint the cell each time there is a new number. Data is sorted.

    See example.

    1 - Color A
    1 - Color A
    1 - Color A
    2 - Color B
    2 - Color B
    3 - Color A
    3 - Color A
    3 - Color A
    4 - Color B
    5 - Color A

    I know Excel VBA, but is looking for some logic to recognize each time there is a number.
    Last edited by mkvassh; 07-14-2021 at 10:25 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Paint cell if data change

    Take a look at the MOD() function in combination with conditional formatting. You can also place a sample file.
    Messages have been translated from Dutch to English by means of google translate.

  3. #3
    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,460

    Re: Paint cell if data change

    Based on your very minimal sample data, you could create tow rules, one using ISODD and the other ISEVEN.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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.

  4. #4
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2010
    Posts
    230

    Re: Paint cell if data change

    The numbers repeat themselves irregularily, like shown in the example. Sometimes not at all, one time, two times etc. It can also be any type of number between 1 and 1.000.000. I thought MOD, ISODD, ISEVEN is looking for a fixed pattern.

    See attached example with an "As Is" - sheet and "To Be" - sheet
    Attached Files Attached Files

  5. #5
    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,460

    Re: Paint cell if data change

    My suggestion was based on what you showed us in the opening post. That's nothing like what you have now shared with us. I'll have another think.

  6. #6
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2010
    Posts
    230

    Re: Paint cell if data change

    Sorry if I was unclear on this AliGW. Appreciate any help.

  7. #7
    Valued Forum Contributor
    Join Date
    06-23-2021
    Location
    Romania
    MS-Off Ver
    2021, 365 v 2208
    Posts
    722

    Re: Paint cell if data change

    No VBA need, just Conditional Formatting with a helper column
    In B2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and format conditional with ISODD or ISEVEN
    or this:
    HTML Code: 
    Last edited by tanasedn; 07-14-2021 at 10:20 AM.
    Diana Tanase


    If the solutions offered helped you to solve your problem, then mark the thread as SOLVED (thread tools in the top menu) and you can click on * to add reputation to those who helped you, as a way to say thank you !

  8. #8
    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,460

    Re: Paint cell if data change

    Yes, very easy with a helper column!

    If that is OK, I'll stop working on this - I was looking for an all-in-one solution with no helper column.

  9. #9
    Forum Contributor
    Join Date
    11-02-2007
    Location
    Bryne, Norway
    MS-Off Ver
    Microsoft Office Excel 2010
    Posts
    230

    Re: Paint cell if data change

    Thank you all. Much appreciated. Problem solved.

  10. #10
    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,460

    Re: Paint cell if data change

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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Paint cell when appear one specific number
    By kREM1993 in forum Excel General
    Replies: 3
    Last Post: 02-23-2018, 02:24 PM
  2. [SOLVED] 2 way lookup to paint cell
    By RalphJ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2015, 07:14 AM
  3. if blank cells, paint yellow. if cell to left is less than a number, don't paint
    By curbster in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2009, 02:40 AM
  4. [SOLVED] Paint a cell ?
    By Skic in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2005, 04:05 PM
  5. [SOLVED] Use VBA to format paint cell(s)
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2005, 03:05 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