+ Reply to Thread
Results 1 to 11 of 11

highlight in red if over 3 days excluding weekend

  1. #1
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    highlight in red if over 3 days excluding weekend

    I found some duedate codes in this site but not for this one.

    if date in column I is over 3 working days from date on column B in same row, would like the cell in Column I to be highlighted in red but those 3 working days (week days) are not including weekend

    Hope this make sense and have attached the dummy workbook for sample

    Thank you in advance.


    Illegal Dumping Register sample.xls
    Last edited by unley; 07-21-2010 at 05:49 PM.
    I'm using MS Office 2013

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: highlight in red if over 3 days exluding weekend

    Hello Unley,

    This would be highlighted in red if the follow up date is more than 3 day (less weekends) from the discovery date?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Re: highlight in red if over 3 days exluding weekend

    Yes that's right
    Last edited by unley; 07-20-2010 at 10:02 PM.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: highlight in red if over 3 days exluding weekend

    Hello Unley,

    I added 2 macros to the attached workbook. One is in the Worksheet_Change event module and the other is in module 1. Here is the code...

    Worksheet_Change() Event Code
    Please Login or Register  to view this content.

    Module1 Code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Re: highlight in red if over 3 days exluding weekend

    Thank you Leith Ross for your time but when I increased the date in Column I and saved the workbook, the highlight did'nt seem to work when I reopen the workbook


    Illegal Dumping.xls

  6. #6
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: highlight in red if over 3 days excluding weekend

    Maybe I am missing something, but is a macro required here?
    Can't you just use conditional formatting in cell I4 with following condition?

    Please Login or Register  to view this content.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: highlight in red if over 3 days excluding weekend

    Hello Unley,

    I couldn't troubleshoot the problem till this morning. It seems the code must all reside in the Worksheet_Change event. Calling the Sub from the event procedure doesn't work consistently. I moved all the code into the event procedure and it works. Her is the updated macro and workbook.

    Worksheet Event Macro Code
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Re: highlight in red if over 3 days excluding weekend

    Thank you very much Leith Ross for this and for your time, it works.

    Ajaykgarg, your formula works if another column is inserted for the code to work but the person who uses this workbook don't want any columns changed but thank you too

  9. #9
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: highlight in red if over 3 days excluding weekend

    Unley, I don't see the need to insert a new column for the code (conditional formatting) to work. You can just apply this conditional formatting on cells in column I.

  10. #10
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Re: highlight in red if over 3 days excluding weekend

    Ok I was thinking of a different formula so thank you for your help

  11. #11
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: highlight in red if over 3 days excluding weekend

    Forgot attachment in my last post.
    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)

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