+ Reply to Thread
Results 1 to 2 of 2

Dates Macro. Calculating date based on current date and input date

Hybrid View

  1. #1
    Registered User
    Join Date
    04-30-2018
    Location
    BUffalo, New York
    MS-Off Ver
    MS Office 2013
    Posts
    1

    Dates Macro. Calculating date based on current date and input date

    I am currently working on a project wherein i require Cell A1 to have a user inputted date say todays date as start date of April 30, 2017. In cell B1, I want the macro to auto generate a date that is 30 days from today including the weekends.

    In Cell C1 i want the macro to enter 60 days from today and in cell D1 to enter 90 days from todays inputted date. The macro should update all three fields once the date is updated.

    This trend should follow in Column A, Column B and Column C, Column D, Column E and Column F everytime the date changes in Column A,

    Cell E1 must have a date that is 2 weeks from the date in A1
    Cell F1 must a date that is have 3 weeks from the date in A1.

    Part 2

    If today's date is 4 days before the date in B1, C1, D1 E1.F1 Then excel will change the cell color to Blue
    If todays date is 2 days before the date in B1, C1 D1, E1, F1 Then excel will change the cell color to Yellow
    If todays date in 1 day before the date in B1, C1, D1, E1 F1 then excel will change the cell color to RED.

    ANy help is greatly appreciated.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,864

    Re: Dates Macro. Calculating date based on current date and input date

    Do you need macro to do it?
    Because it can be easily done just with formulas.
    so for instance B1 could read:
    Formula: copy to clipboard
    =A1+30
    or a bit more sophisticated :-P
    Formula: copy to clipboard
    =IF(ISNUMBER(A1),A1+30,"")

    And so on.

    The second part (highlighting cells by the difference between their content and today's date) could be easily achieved with Conditional Formatting (using formula to create a formating rule).
    Best Regards,

    Kaper

+ 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] Trying to calculate- compares two dates, chooses later date, tells days to current date
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-31-2016, 12:20 PM
  2. Replies: 4
    Last Post: 02-28-2016, 06:09 PM
  3. Highlight Rows Based on Date Range Using Static Date and Current Date
    By SaraStravers in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-23-2015, 07:38 PM
  4. Calculate next due date based on start date frequency and current date
    By ironoverload in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-09-2014, 07:08 AM
  5. [SOLVED] Date Filter based on Cell Input - single date or range of dates
    By babaloo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-23-2012, 10:32 AM
  6. Calculating dates based on the current date
    By DavidW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2006, 08:50 AM
  7. [SOLVED] [SOLVED] Calculating days between current date and a date in future NETWORKDAYS() fun
    By Faheem Khan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-10-2005, 04:06 PM

Tags for this Thread

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