+ Reply to Thread
Results 1 to 4 of 4

How to detect if a date is within 30 days of today's date?

  1. #1
    Registered User
    Join Date
    10-02-2015
    Location
    Pennsylvania
    MS-Off Ver
    2007
    Posts
    33

    Question How to detect if a date is within 30 days of today's date?

    Hi All,

    If I have a date variable bigDate="04/11/16", is there a way in VBA, to code if that date falls with in 30 days of today's date?

    (So that would mean if today's date is 4/7/16, or 4/20/16, it should return True ... but if today's date is 5/30/16, it should return false)

    Thanks so much,
    JMC

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to detect if a date is within 30 days of today's date?

    Please Login or Register  to view this content.
    Last edited by shg; 04-07-2016 at 11:47 AM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    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

    Re: How to detect if a date is within 30 days of today's date?

    http://www.excelforum.com/excel-gene...days-date.html

    Co-incidence or what?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    10-02-2015
    Location
    Pennsylvania
    MS-Off Ver
    2007
    Posts
    33

    Re: How to detect if a date is within 30 days of today's date?

    Hi SHG & Richard,

    Thank you so much! This worked perfectly!

    And Richard: Holy moley! This was asked within 3 minutes of my post? Crazy! I also thought it might be a popular question, but came to no avail on a search...perhaps if I would have waited a few minutes longer! :-) Thanks again!!

    JMC

+ 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. Calculate number of days between invoice date and today's date
    By JHerrick in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-30-2020, 03:53 PM
  2. testing if one date exceeds today's date by a specific number of days with vba
    By Dana_Carter in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-08-2016, 07:49 PM
  3. Replies: 4
    Last Post: 02-28-2016, 06:09 PM
  4. [SOLVED] Unlock only if column date is equal to today's date +/- 2 days
    By Cobelatte in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-22-2015, 01:30 PM
  5. Replies: 4
    Last Post: 05-08-2014, 10:13 AM
  6. [SOLVED] Macros for: If Today's Date minus other date is greater than certain amount of days Then
    By lottidotti in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-24-2012, 04:46 PM
  7. create a macro to alert me if today's date is within 5 days of expected delivery date
    By ashmcclure in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 09-25-2008, 05:51 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