+ Reply to Thread
Results 1 to 5 of 5

Conditional formatting if cell value <> value of previous cell

  1. #1
    Registered User
    Join Date
    12-20-2014
    Location
    **** off advertising spam shite
    MS-Off Ver
    Yer Ma
    Posts
    4

    Conditional formatting if cell value <> value of previous cell

    I have a sheet of percentages in columns where each cell is already populated with a formula. I want to format the font of each cell in a column based on whether it is greater or less than the previous cell, i.e. If B4>B3 make it green, if it's less make it red. Google has given me nothing but formatting based on fixed values, not 'whatever cell x contains' so am at a bit of a loss.

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Conditional formatting if cell value <> value of previous cell

    how versed are you with private sub like "selection change" or "change"? either one can be programmed to do that. For ad-hoc results please send a sample excel file

  3. #3
    Registered User
    Join Date
    12-20-2014
    Location
    **** off advertising spam shite
    MS-Off Ver
    Yer Ma
    Posts
    4

    Re: Conditional formatting if cell value <> value of previous cell

    VBA is a bit over my head but I'd be happy to have a play if you gave me a start on the code. Attached is sanitised version of my workbook. Currently only 2 rows of data but this will increase week by week and current formatting was done manually. In essence just want cell colour to be green if the value is greater than the cell above it, or red if the value is less than the cell above it.
    Book1.xlsx

  4. #4
    Registered User
    Join Date
    12-20-2014
    Location
    **** off advertising spam shite
    MS-Off Ver
    Yer Ma
    Posts
    4

    Re: Conditional formatting if cell value <> value of previous cell

    Actually, I've found a solution by not being a chump and realising you can have multiple CF rules within the same cell.

  5. #5
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Conditional formatting if cell value <> value of previous cell

    The basic macro does the job for the data you sent.

    Nevertheless, I noticed that there are more than 1 company reporting, so the marketshare sheet should refer only to one company?
    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)

Similar Threads

  1. Conditional Formatting and Cell Referencing Previous Cell
    By xxluverxx in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-22-2014, 11:14 AM
  2. Replies: 3
    Last Post: 07-17-2014, 03:08 PM
  3. Conditional Formatting for previous cell change
    By no.18shirt in forum Excel General
    Replies: 14
    Last Post: 07-02-2013, 07:14 AM
  4. Replies: 3
    Last Post: 04-06-2011, 01:15 PM
  5. Replies: 5
    Last Post: 11-17-2010, 04:23 AM

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