+ Reply to Thread
Results 1 to 4 of 4

If range A = x/y/z colour adjacent cell

  1. #1
    Registered User
    Join Date
    01-12-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    20

    If range A = x/y/z colour adjacent cell

    hi,

    After some help with a macro.

    I have a spreadsheet that tracks staff, in column F the value if either empty, "OK" or other

    if a cell in column F1 -> Last Row is empty the cell to its left remains uncoloured, if it is "OK" the cell to the left is green, and if the cells is anything else then the cell to the left should be red.

    it works with standard conditional formatting but everytime a new row is inserted it breaks the CF up into more than one rule and over time it gets very clogged up and sometimes breaks.

    I've tried to get bits of code of the new to make this myself but im getting no where, so i would greatly appreciate it if someone could create a working macro that does this on the fly.

    Much appreciated.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: If range A = x/y/z colour adjacent cell

    Rather than a macro, try this first (on a back up copy)

    1. Select all of the cells and clear the conditional formatting
    2. Select all of the cells, again if needed, and re-apply your conditional formatting
    3. Convert the data range into an Excel Table: Menu > Insert > Table ( you should be using a header row )

    The Table will automatically extend all formatting and formulas to new rows and you shouldn't encounter the issue you described above.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    01-12-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: If range A = x/y/z colour adjacent cell

    Quote Originally Posted by Palmetto View Post
    Rather than a macro, try this first (on a back up copy)

    1. Select all of the cells and clear the conditional formatting
    2. Select all of the cells, again if needed, and re-apply your conditional formatting
    3. Convert the data range into an Excel Table: Menu > Insert > Table ( you should be using a header row )

    The Table will automatically extend all formatting and formulas to new rows and you shouldn't encounter the issue you described above.
    Done step by step and its still breaking the CF up, also one thing this does mess up is the cell merge, columns f,g,h are all merged in that range.

  4. #4
    Registered User
    Join Date
    01-12-2013
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: If range A = x/y/z colour adjacent cell

    Ok, ive found some code online that does exactly what i need: http://www.rondebruin.nl/find.htm

    ive managed to modify to the code to find what i want and turn the adjacent cell green, but how can i get it to do the check for an empty cell and to check if its anything other than empty or "OK"
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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