+ Reply to Thread
Results 1 to 9 of 9

Macro conditional format

  1. #1
    Registered User
    Join Date
    04-02-2020
    Location
    Bratislava
    MS-Off Ver
    2016
    Posts
    80

    Macro conditional format

    Hello again guys, I hope it is going good.

    I am currently setting up a vacation assignment workbook for my team and would like to highlight some cells based on a value. See the attached screenshot.
    I would like to highlight cells "V" in green when their count is not greater than the value in column NN. Thus, when the number of "V" exceeds the value in the NN column, the additional V will be highlighted in red.

    Thanks for helping once again,
    AM
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro conditional format

    What do you mean by
    to highlight cells "V" in green
    Which column is it ? Is it column "NL", if yes then quite all cells are red, is not it ?
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    04-02-2020
    Location
    Bratislava
    MS-Off Ver
    2016
    Posts
    80

    Re: Macro conditional format

    for example, for "alashera" he has 1 vacation day that he does not need to wait for approval ("V" should appear in green), but he will have to request the other 3 days ("V" in red). The red "V" should appear if the number of "V" in each employee's row is greater than the value in the "NM" column.
    I'd like to have this proccess automated for each employee.

    Thanks

  4. #4
    Registered User
    Join Date
    04-02-2020
    Location
    Bratislava
    MS-Off Ver
    2016
    Posts
    80

    Re: Macro conditional format

    Hi,
    I'm just looking for the structure of the code in VBA. I know it could be something with loops comands and If and For functions, but I do not know how to structure the code.
    It would be appreciated some help

    Regards,

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro conditional format

    See here a short piece of code which could work .... not completely tested because there is conditional format and therefore the color fill is not seen
    Why don't you use a conditional format formula to do what you expect ...?
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-02-2020
    Location
    Bratislava
    MS-Off Ver
    2016
    Posts
    80

    Re: Macro conditional format

    Hi,
    it works really well your solution! but how can I do it with conditional format?
    Could we have the code identify the cells in order? in the sense that the cells that are modified first (appear in green) take precedence over those that are modified later (in red). The macro modifies in order and does not have this preference.
    but if you consider the condicional format would be better let me know


    Thank you for your help :D
    Last edited by lasher18; 05-08-2020 at 03:44 PM.

  7. #7
    Registered User
    Join Date
    04-02-2020
    Location
    Bratislava
    MS-Off Ver
    2016
    Posts
    80

    Re: Macro conditional format

    hey,
    do you know how can I do it with conditional format?

    Thanks

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro conditional format

    I started to do it but the copy-paste of the conditional format does not work properly, therefore it must be prepared for each cell.
    That is where I am today, it seems difficult to use it right now.

  9. #9
    Registered User
    Join Date
    04-02-2020
    Location
    Bratislava
    MS-Off Ver
    2016
    Posts
    80

    Re: Macro conditional format

    Ok, good, could you tell me in what way are you doing it? can you put an example and I'll try it by my own

    Thanks

+ 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] Macro to delete row when conditional format met
    By oeyandyprawira in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-07-2016, 02:25 AM
  2. Conditional format macro
    By gaurangaero in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-02-2013, 07:45 AM
  3. Conditional format macro
    By dasadler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2010, 03:19 AM
  4. Conditional Format a Row (Macro)
    By jamessaunders in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2007, 01:09 PM
  5. Conditional format macro
    By Elaine in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2006, 12:15 PM
  6. Conditional Format as a MACRO
    By Gunjani in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-29-2006, 12:25 PM
  7. conditional format macro formula
    By Todd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2006, 01:35 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