+ Reply to Thread
Results 1 to 8 of 8

overflow error when using DateAdd

  1. #1
    Registered User
    Join Date
    06-13-2015
    Location
    NC, USA
    MS-Off Ver
    Office 2016 for Mac
    Posts
    29

    overflow error when using DateAdd

    Here is my code:


    Please Login or Register  to view this content.

    About half the time, I get a runtime error '6' Overflow error.

    What gives????

    Thanks for the help!

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: overflow error when using DateAdd

    Do you need to do this : CDbl(i) ?
    Why not
    Please Login or Register  to view this content.
    ?
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Registered User
    Join Date
    06-13-2015
    Location
    NC, USA
    MS-Off Ver
    Office 2016 for Mac
    Posts
    29
    Quote Originally Posted by bulina2k View Post
    Do you need to do this : CDbl(i) ?
    Why not
    Please Login or Register  to view this content.
    ?
    Yes that was actually my original code. I added the CDbl as an attempt to fix the issue. (Which of course it did not lol)

  4. #4
    Registered User
    Join Date
    06-13-2015
    Location
    NC, USA
    MS-Off Ver
    Office 2016 for Mac
    Posts
    29

    Re: overflow error when using DateAdd

    Also, it should be noted that I am running Excel for Mac 2016

  5. #5
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: overflow error when using DateAdd

    I could not recreate the error but I would try to declare i as Long. Have you tried that?

  6. #6
    Registered User
    Join Date
    06-13-2015
    Location
    NC, USA
    MS-Off Ver
    Office 2016 for Mac
    Posts
    29

    Re: overflow error when using DateAdd

    OK, I just tried declaring i as Long, and it did not work. I then removed the CDbl(), which also did not change anything.

    Here is the code in it's entirety for this function:


    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-13-2015
    Location
    NC, USA
    MS-Off Ver
    Office 2016 for Mac
    Posts
    29

    Re: overflow error when using DateAdd

    I am still having the error.. Does anyone have an idea?? Please and thank you!!

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

    Re: overflow error when using DateAdd

    What are the values of all the variables in the statement when the code errors?
    Entia non sunt multiplicanda sine necessitate

+ 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] dateAdd Overflow
    By rmweaver81 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2013, 01:15 PM
  2. Overflow error
    By VelvetRevolver84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-23-2013, 11:50 PM
  3. Explanation of the Run-time error '6': Overflow Error
    By mgphill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2012, 10:46 AM
  4. Want to do a while-loop but get error message: run error '6' overflow
    By danzi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2011, 01:48 PM
  5. Msg error (overflow)
    By Mamud in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-25-2011, 10:54 AM
  6. Overflow error
    By share knowledge in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-02-2010, 02:07 AM
  7. Error 6 Overflow
    By tekapo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2010, 05:07 AM
  8. Overflow Error
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2010, 02:08 AM

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