+ Reply to Thread
Results 1 to 6 of 6

VBA Conditional formatting with cell offset

  1. #1
    Registered User
    Join Date
    08-14-2014
    Location
    Nottingham, England
    MS-Off Ver
    2007
    Posts
    5

    VBA Conditional formatting with cell offset

    Hi all,

    What i'm trying to do is create a conditional formatting that will colour the cell the information is in and also the cells in the columns to the right.

    E.g.
    If cell A1 is the string "Apples", i need A1 to be Green and also cells B1 & C1
    If cell A2 says "Oranges" A2 will be Orange and so will B2 & C2

    This is for use on about 10 different "fruits" so i can't use the inbuilt conditional formatting so i'm thinking a VBA route in the worksheet.
    In addition (don't know if it will effect it or not) but the string in question is actually a formula pulled from a master record when looking up against a product ID using a Vlookup formula (the product ID is in the B column of the worksheet.

    Hope i've described what i'm after ok and isn't too confusing, any help on this would be greatly appreciated

    Thanks in advance

  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
    44,447

    Re: VBA Conditional formatting with cell offset

    This is for use on about 10 different "fruits" so i can't use the inbuilt conditional formatting

    Why do you say that?
    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
    Registered User
    Join Date
    08-14-2014
    Location
    Nottingham, England
    MS-Off Ver
    2007
    Posts
    5

    Re: VBA Conditional formatting with cell offset

    Thought the inbuilt conditional formatting was restricted to three?

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA Conditional formatting with cell offset

    Only in pre 2007 excel versions, not in 2007 and beyond versions.

  5. #5
    Registered User
    Join Date
    08-14-2014
    Location
    Nottingham, England
    MS-Off Ver
    2007
    Posts
    5

    Re: VBA Conditional formatting with cell offset

    Ah, obviously wasn't aware, thx for help

  6. #6
    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
    44,447

    Re: VBA Conditional formatting with cell offset

    http://office.microsoft.com/en-gb/ex...010217629.aspx

    In previous versions of Excel, you could have a maximum of three conditional formats. There’s no such limit in Office Excel 2007; you may have as many conditional formats as you like. The other major limitation of conditional formats in Office Excel 2003 and earlier versions was that Excel stopped evaluating conditional formats as soon as it found one that applied to a cell. In other words, you couldn’t have multiple conditions be true for the same cell! In Office Excel 2007, you can control whether Office Excel 2007 stops or continues after it discovers that a specific condition applies to a cell.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. [SOLVED] Conditional Formatting Offset
    By tommy_m in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-16-2012, 04:41 PM
  2. Conditional formatting for percent is offset
    By danl1952 in forum Excel General
    Replies: 2
    Last Post: 07-14-2012, 09:52 AM
  3. Offset in conditional formatting
    By Diddy in forum Excel General
    Replies: 1
    Last Post: 03-27-2011, 12:07 PM
  4. Offset conditional formatting
    By Ducatisto in forum Excel General
    Replies: 7
    Last Post: 10-03-2008, 03:55 AM
  5. Conditional Formatting - offset ?
    By HUMBERTDING in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-09-2008, 05:32 AM

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