+ Reply to Thread
Results 1 to 5 of 5

Message Box that inserts dates in ranges

  1. #1
    Registered User
    Join Date
    01-15-2011
    Location
    Clearfield, UT
    MS-Off Ver
    Excel 2016
    Posts
    58

    Message Box that inserts dates in ranges

    Forum: I have a simple message box that will insert today's date in the range I4:I7 but I'd like to insert a different date (a year earlier) in the range I8:I11. I know subtracting 365 from "= Date," won't work, but since I don't know the correct code, I've put it there so you can see what I'm hoping to achieve. Any help will be appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Message Box that inserts dates in ranges

    It does work. You typed a comma and messed up the command.


    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    01-15-2011
    Location
    Clearfield, UT
    MS-Off Ver
    Excel 2016
    Posts
    58

    Re: Message Box that inserts dates in ranges

    Wow, too simple. Thank you mehmetcik.
    JPDutch

  4. #4
    Registered User
    Join Date
    08-09-2015
    Location
    CzR
    MS-Off Ver
    MS Office 2013
    Posts
    41

    Re: Message Box that inserts dates in ranges

    BE AWARE, it does NOT work fro two reasons!!!
    1. You have 3 calls of the Date function. The first call can be executed just before midnight and one of the next two calls after midnight.
    2. Not all years have 365 days, I hope you know it.

    The correct code:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-09-2015
    Location
    CzR
    MS-Off Ver
    MS Office 2013
    Posts
    41

    Re: Message Box that inserts dates in ranges

    Sorry, I see now that I deleted two " by mistake. The correct code:

    Please Login or Register  to view this content.

+ 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 that evaluates rows of dates, inserts blank rows between different weeks
    By Wedge120 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-26-2014, 11:16 PM
  2. [SOLVED] Working with Ranges - Error Message if Any Cell Blank
    By MKWilson in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 09-22-2014, 11:41 AM
  3. Displaying Data ranges both in rows and columns in the Message box
    By neomad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2013, 09:17 AM
  4. [SOLVED] excel formula to help my calculation from min dates of 3 dates cell ranges
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2013, 10:32 AM
  5. comparing two named ranges and if at least one match display a message
    By jwarner000 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-04-2013, 08:01 PM
  6. x Axis inserts extra dates
    By Jerry in forum Excel General
    Replies: 1
    Last Post: 08-30-2005, 11:05 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