+ Reply to Thread
Results 1 to 2 of 2

Fill Color if Cell meets condition of another cell

  1. #1
    Registered User
    Join Date
    07-02-2015
    Location
    Hell
    MS-Off Ver
    excel 2007
    Posts
    1

    Fill Color if Cell meets condition of another cell

    Good Morning Friends

    My name is Robert and this is my first time posting on these wonderful forums. I have perused through these forums many times to develop macros but this one has me stumped. Perhaps it cant be done but Id love to see what you wizards can do for me. Before I get to the specifics I just want to let you know that I greatly appreicate yoi taking the time to read my post and/or helping me with this matter. I am in your debt.

    So I am looking for a code to include into a macro that will take a cell in Column G, Highlight it Orange, Accent 6, Lighter 40% based on a value of a cell in column AX.

    **Specifics**
    (I made this before i learned about the insert table feature, figured it might have some value so I left it)
    Header [ ..G.. ] ........................................[ ..AX.. ]
    ..G10 [ ..10.. ] <-- Total
    ..G11 [ ..5.. ] <-- 50% .......................AX11 [ ..50%.. ]
    ..G12 [ ..2.9.. ] <-- 29% (79%) ...........AX12 [ ..79%.. ]
    ..G13 [ ..2.1.. ] <-- 21% (100) ............AX13 [ ..100.. ]


    G Column AX Column
    10
    5 50%
    2.9 29%(79%)
    2.1 21%(100%)



    I hope you can decipher this diagram. What I want it to do is Highlight any cell in G that is less then or equal to 79.99% based on the number in cells in the AX Column. I Will be happy to explain this further if needed.


    XOXO
    Last edited by RobIzq; 07-30-2015 at 02:38 PM.

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Fill Color if Cell meets condition of another cell

    Hi,

    Is there a reason you need this to be in a macro? Because Conditional Formatting will do it very easily. Select the range in G you want to be formatted (let's say G3:G100), go to 'Conditional Formatting' on the Home tab, select 'New Rule' then 'Use a formula to determine which cells to format'. Now enter this formula in the box below:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    then select the formatting you want using the 'Format' button (Fill ... Orange/Accent6/Lighter40%). Click OK and the cells in the column G range will be coloured based on the values in column AX.

    If you really need this to be in a macro, you could just start a macro recording, do the above steps, stop the macro, then have a look at the code. That would give you something like this:
    Please Login or Register  to view this content.
    The code above could be tidied up quite a bit but that gives you an idea of the sort of expressions you'd need.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.

+ 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] Toggle fill Color in cell based on condition of cell--blank or text added.
    By moosetales in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2014, 08:39 PM
  2. [SOLVED] Add borders to row if first cell meets condition
    By bullshot25 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-08-2013, 10:14 AM
  3. How to add points to a cell if another cell meets a condition?
    By TheVolkinator in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-21-2012, 02:42 PM
  4. Replies: 4
    Last Post: 05-25-2012, 04:16 AM
  5. Replies: 6
    Last Post: 07-03-2009, 05:25 AM
  6. Find value for a cell that meets a condition?
    By lanix in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-06-2007, 03:57 AM
  7. Replies: 4
    Last Post: 01-12-2006, 09:50 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