+ Reply to Thread
Results 1 to 12 of 12

color cell if greater

  1. #1
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    color cell if greater

    Hi,
    this macro created with the recorder must work for the range A2:A5

    Please Login or Register  to view this content.
    john
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: color cell if greater

    To row 25 or row 5?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: color cell if greater

    Hi alan
    to 25

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: color cell if greater

    Only modified to perform a loop. Did not make any changes to your code algorithm.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: color cell if greater

    Hi alan,
    the macro does not color all the cells some remain white
    Attached Files Attached Files

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: color cell if greater

    As I indicated earlier, I did not test your code. If you explain what you want explicitly, ie. Which cells to be colored and what color, I will rewrite it to efficiently do what you want. You used the recorder and I did not evaluate your code. I only added a loop to your code. Please advise.

  7. #7
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: color cell if greater

    In column C formula
    = IF (B2> 100, "mag", "min")

    macro example

    if B2 = min colors A2 red
    if B2 = mag colors A2 light blue

  8. #8
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604

    Re: color cell if greater

    Why only C2?
    Please Login or Register  to view this content.
    Ben Van Johnson

  9. #9
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487
    Hi prontoleah
    Example
    If c2 = min color red
    If c2 = mag color light blue
    If c20 = mag color light blue
    If c12 = min color red

  10. #10
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: color cell if greater

    Hello all
    this is the macro I am looking for.
    is it possible to reduce it?

    Please Login or Register  to view this content.

  11. #11
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604

    Re: color cell if greater

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: color cell if greater

    Hi protonleah,
    it's o.k., work well
    Thanks you
    john

+ 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. Replies: 7
    Last Post: 03-06-2015, 07:30 PM
  2. [SOLVED] VBA to color the cell to Red if Cell value is greater then 0
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-08-2014, 01:55 PM
  3. [SOLVED] Change a cell color per greater than/less than formula
    By Steel City in forum Excel General
    Replies: 6
    Last Post: 08-31-2013, 05:55 PM
  4. Change Cell color based on greater than, less than formula
    By Directorboy in forum Excel General
    Replies: 2
    Last Post: 03-07-2013, 11:18 AM
  5. [SOLVED] count the length of each cell in a row and change color if greater than 24
    By mshirley15 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2012, 04:21 PM
  6. how to change the color of a cell if the value of it is greater than another cell
    By suhailtholakkal in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-24-2011, 05:30 AM
  7. Replies: 3
    Last Post: 10-22-2009, 07:20 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