+ Reply to Thread
Results 1 to 5 of 5

Coloring cells to left and right based on cell value

  1. #1
    Registered User
    Join Date
    10-13-2011
    Location
    Jozi, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    93

    Coloring cells to left and right based on cell value

    Hello all,

    I am using the following code to change a range of cells color based on a specific value.

    The following working code colors current cell + 4 cells to right:
    Please Login or Register  to view this content.
    The following fails when trying to color cells to left:
    Please Login or Register  to view this content.
    Not sure what i am doing wrong. Ultimately, i want to color cells in the current row from column A to column Q based on cell value of column M.

    Full code:
    Please Login or Register  to view this content.
    ***------ Coding for Fun ------***

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Coloring cells to left and right based on cell value

    Which is the condition for column M?

    Why don't you use just Conditional Formatting?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    10-13-2011
    Location
    Jozi, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Coloring cells to left and right based on cell value

    I have not looked into it, has to be done in VBA though.

    Just looking for something simple and easy to code, i am not sure how to start with conditional formatting.

  4. #4
    Registered User
    Join Date
    10-13-2011
    Location
    Jozi, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    93

    Re: Coloring cells to left and right based on cell value

    Condition is, if Cell value <> 0

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Coloring cells to left and right based on cell value

    So nothing simplest from CF in this case!

    Formula in CF rules.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    How can you use Conditional Formating.

    --In Excel 2007 and 2010, Conditional Formatting is in the Styles group on the Home tab. In Excel 2003, Conditional Formatting is on the Format menu. See here how you can work using CF.
    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. [SOLVED] Coloring Cells based on adjacent cell color
    By smugglersblues in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 01-04-2013, 09:36 PM
  2. [SOLVED] Coloring cells based on value in another cell
    By killerthun in forum Excel General
    Replies: 2
    Last Post: 08-16-2012, 08:21 AM
  3. Inserting cells to the left based on cell value
    By Judge Dredd in forum Excel General
    Replies: 5
    Last Post: 03-11-2011, 04:39 AM
  4. Coloring 3 cells based on condition in 1
    By Pasha81 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-20-2009, 11:55 AM
  5. Conditional coloring of Excel cells, based on adjacent cell values?
    By Greg Stuart in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-10-2006, 06:20 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