+ Reply to Thread
Results 1 to 3 of 3

How do I fill rows based on a data changing down a column

Hybrid View

  1. #1
    Registered User
    Join Date
    10-05-2023
    Location
    Illinois
    MS-Off Ver
    Microsoft 365
    Posts
    1

    How do I fill rows based on a data changing down a column

    Can someone help me with a macro or code to essentially highlight an entire row based on a data changing throughout a column. I am unable to post images yet but I will best try to describe with an in-message table, but this is for excel.


    Number Name Item
    201358
    201358
    201358
    279090001
    279090001
    279090001
    279090002
    279090002
    279090002


    Based on this examlple, I am asking if something could be run for it to highlight all the "201358" rows grey, be able to see the 279090001 being different and make those rowswhite. Then alternating back to grey for 279090002, so on and so forth.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,479

    Re: How do I fill rows based on a data changing down a column

    One way.

    Use column D as a Helper column. In cell D2, put the formula
    Formula: copy to clipboard
    =IF(A2=A1,N(D1),IF(D1=1,2,1))
    and copy it down.

    Now us the Helper column for your Conditional Formatting. 1 = grey, 2 = white.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,479

    Re: How do I fill rows based on a data changing down a column

    Is this resolved? Or do you need more help?

    If you need more help ... Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.


    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. Replies: 2
    Last Post: 04-04-2022, 12:51 AM
  2. [SOLVED] Fill specific rows with value based on a list of rows in a different column
    By Svitlana Conf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-23-2020, 09:45 AM
  3. [SOLVED] column has gaps; need to fill rows with data, based on another column
    By StarFyre in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-26-2016, 04:48 PM
  4. [SOLVED] need to fill in rows based on column a information
    By AWITCHER in forum Excel General
    Replies: 4
    Last Post: 05-13-2015, 03:43 PM
  5. Replies: 3
    Last Post: 04-12-2013, 04:36 PM
  6. Changing cell fill colour based on date in cell - Multiple rows
    By ExcelNewb2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2010, 07:30 AM
  7. [SOLVED] Auto Fill Column with Date based on rows in other column
    By JOUIOUI in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2006, 01:35 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