+ Reply to Thread
Results 1 to 26 of 26

create a macro to alert me if today's date is within 5 days of expected delivery date

  1. #1
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14

    create a macro to alert me if today's date is within 5 days of expected delivery date

    I have a worksheet that has a sent date and expected delivery date I need create a macro that will alert me if today's date is within 5 days of expected delivery date. please help

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi, and welcome to the forum.

    No need for a macro. Just name the delivery date cell "deliverydate" and the today date cell "todaysdate", then use the following function.

    Please Login or Register  to view this content.
    You could also usefully put a conditional format on the cell that contains that IF() function, and have the cell turn say red if true.

    HTH

  3. #3
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14

    I do need a macro

    thanks for the welcome & actually I do need a macro. I give a bit more detail. I have a workbook that has po# date entered. info that goes w/ order. then a column for del. date & column for recv'd. what I the macro to do is if the del. date is w/in 5 days of today and the recv'd column is empty to turn it red so someone can be alerted since the work book is opened everyday. I pretty much have the rest of the macro figured out but not sure how to word w/in 5 days of today.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    cf as
    =AND(ISBLANK(B2),TODAY()-A2<=5)
    wher b2 is rec date and a2 deliv date

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by ashmcclure View Post
    thanks for the welcome & actually I do need a macro. I give a bit more detail. I have a workbook that has po# date entered. info that goes w/ order. then a column for del. date & column for recv'd. what I the macro to do is if the del. date is w/in 5 days of today and the recv'd column is empty to turn it red so someone can be alerted since the work book is opened everyday. I pretty much have the rest of the macro figured out but not sure how to word w/in 5 days of today.
    Use Conditional Formatting

    http://www.excel-it.com/excel_condit...formatting.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    conditional formatting not working the way i need it to any other suggestions i can plug into a macro

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why is Conditional Formatting not working?

  8. #8
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    I have 9 columns the third is the date the po is entered the 8th is the expected delivery date. the 9th is the received date. I need the entire row to be highlighted red when the delivery date is within 5 days of today when the received date is blank. conditional formating does not do that

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Yes it does if you apply the formatting to the whole row

  10. #10
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    I have a whole workbook I'm trying to apply it to. And with your input I was able to highlight the range from 5 before today as well as 5 after today but I need it only if the received date is empty and so far with conditional formatting it just makes all the days red whether delivery date or received w/in that time frame and sadly not what i'm trying to do maybe i need another condition but as i understood it a macro would work better for a loop to repeat everyday maybe i'm wrong thanks for all the help
    Attached Files Attached Files
    Last edited by ashmcclure; 09-23-2008 at 11:40 AM. Reason: added attachment

  11. #11
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    A macro won't work better, maybe your formats need adjusting. Attach a small exampole workbook

  12. #12
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    I just attached a sample to my previous post. with this workbook. I need the row to be highlight if the del. date column is within 5 days of today and the recv'd column is empty. all other information isn't vital. I have used real dates to help

  13. #13
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    There is no Conditional Format that i can see in the example. Does this work

    Condition 1: Formula is: =$H$2=$I$2
    Condition 2: Formula is: =TODAY()+5=$H$2

  14. #14
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    Thanks yeah I took out all conditioning formating so that it would be cleaned. I did try that and it didn't work. all it did was fill in the empty cells in h and I

  15. #15
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    here is a sample with what i want done automatically. I did it manually w/o cf or a macro. but this is what i would like the outcome to be from either cf or a macro. if I understand everything correctly a macro would be best. any help would be appreciated
    Attached Files Attached Files

  16. #16
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    this worked for me
    =AND(ISBLANK(I2),TODAY()-H2<=5,TODAY()-H2>=0)
    Last edited by martindwilson; 09-23-2008 at 02:37 PM.

  17. #17
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Martin's code works but you must put $ before the I's and H's and have highlighted row 2 down (don't include row 1)
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  18. #18
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    yep forgot the $,well i was leaving work and by the time i remembered was on train home!

  19. #19
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    ok yea that did work thanks. one more question. it highlight everything 5 days before today. i tried modifying it as another formula for 5 from now it did work. how would I do it as a second condition for everything 5 days from today with same conditions???

  20. #20
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    Also since this work book gets update monday - saturday when a new entry is entered will it automatically be included in the conditional formatting or would that have to be done everyday?

  21. #21
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    Quote Originally Posted by ashmcclure View Post
    ok yea that did work thanks. one more question. it highlight everything 5 days before today. i tried modifying it as another formula for 5 from now it did work. how would I do it as a second condition for everything 5 days from today with same conditions???
    I'm sorry I messed up on this one when I tried to modify for it to be 5 days from now it DIDN'T work. So if someone could help me with another condition so that the dates 5 days from today and column I is empty I can highlight it. Thank You in advance

  22. #22
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    =AND(ISBLANK($I2),$H2-TODAY()<=5,$H2-TODAY()>=0)
    will give it if its within 5 days in the future
    as to new entries as long as you put the formating down as far as you feel you need new entries will be ok.
    i wouldnt recoment trying to do the whole sheet tho.
    inserted rows will need re-doing

  23. #23
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    Quote Originally Posted by martindwilson View Post
    =AND(ISBLANK($I2),$H2-TODAY()<=5,$H2-TODAY()>=0)
    will give it if its within 5 days in the future
    as to new entries as long as you put the formating down as far as you feel you need new entries will be ok.
    i wouldnt recoment trying to do the whole sheet tho.
    inserted rows will need re-doing
    what would you suggest for the whole sheet?

  24. #24
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    depends on version of excel. conditional formating 65000+rows times number of columns will use too much memory.
    so say you make 20 entry's a day and want a years worth just do from row
    1 to about 8000 , dont format columms you're not using. say you're using a to z then only do that width, no point changing colours in cells that you are not looking at

  25. #25
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14
    THANKS, yea I'd say about 5000 entries a year. so I will put that into place the cf worked out great thank you very much

  26. #26
    Registered User
    Join Date
    09-18-2008
    Location
    New Mexico
    Posts
    14

    Red face Filtering with same worksheet

    Ok so I got all the conditional formatting working just fine now I need to see if that can be filtered into a report that could be printed. I have attached another copy of the delivery date form complete with conditional formatting..
    SIMPLE BREAK DOWN OF QUESTION: Can all highlighted items be combined so can be printed????? THANK YOU IN ADVANCE
    Attached Files Attached Files
    Last edited by ashmcclure; 09-25-2008 at 05:52 PM. Reason: forgot attachment

+ 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. macro: changing cell color based on date in cell
    By mikewg in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-27-2011, 02:17 AM
  2. build a macro that saves & names a file with the current day's date
    By mariusescu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2008, 10:22 AM
  3. macro to create a macro?
    By jojotherider in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2008, 08:34 PM
  4. looping issues
    By Marcus Gee in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2007, 11:42 PM
  5. Macro to Create Control Chart in Excel
    By ebachenh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2006, 01:52 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