+ Reply to Thread
Results 1 to 5 of 5

Help with overflow

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    Hartford, CT
    MS-Off Ver
    Excel 2003
    Posts
    5

    Lightbulb Help with overflow

    Hi all,

    I am trying to make a userform with several functions that will generate the the first few and last few workdays of a given month. Problem is I am running into a "runtime error '6' overflow. Can anyone help me solve this problem. I have bolded the area where the runtime error occurs.

    Please Login or Register  to view this content.
    Last edited by jscott932; 06-07-2013 at 03:59 PM.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Help with overflow

    Hi,

    1. Please edit your post and use
    Please Login or Register  to view this content.
    z becomes smaller than the minimum value for an integer as this loop will never end..
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    06-07-2013
    Location
    Hartford, CT
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Help with overflow

    So does this mean I should dim z as "long" instead. What datatype would allow this to work? I need the date serial function to make z go backwards. Should I make the variables "IsHoliday" and "IsWeekend" functions and include them in the Do statement before the loop in order to end the infinite loop? How would I correct this? Thank you so much, by the way! I will edit the post with the code tags.

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Help with overflow

    It will not help you to just change the data type to long, you'll get the same error, but after more loopings.

    You need to make the exit condition true at some point, means "IsWeekend" and "IsHoliday" need to get False in the loop to exit it.
    e.g. (don't you have such functions already?)
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-07-2013
    Location
    Hartford, CT
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Help with overflow

    Thank you so much I will try that!
    Last edited by jscott932; 06-10-2013 at 09:07 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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