+ Reply to Thread
Results 1 to 8 of 8

Overflow error, can't see why

  1. #1
    Registered User
    Join Date
    10-25-2011
    Location
    Norrköping Sweden
    MS-Off Ver
    Excel 2003
    Posts
    13

    Overflow error, can't see why

    Hello!

    I'm writing a Macro that is working with two different sheets with the same data for different times, it's gonna take one column from the last one and compare it to a column from the other sheet. The Sheet contains about 2900 rows, and each word/value that it checks must be found in the other one (because they can be changed dissapear betwen timeperiods).
    When I've, for a test, made the two sheets with less values (like 20 instead) it works. The error points at the first loop.

    Anyway here's the code:
    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Overflow error, can't see why

    Hi,

    I'm not really sure, but maybe the offset property is causing the error? Does it work with using Cells in the first loop?
    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626
    Which line of code is causing the error?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    10-25-2011
    Location
    Norrköping Sweden
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Overflow error, can't see why

    Hello!

    It's the third line in the first loop:
    Please Login or Register  to view this content.
    Altough I get the overflow from the two previous lines sometimes as well, gonna try to change the offset function

  5. #5
    Registered User
    Join Date
    10-25-2011
    Location
    Norrköping Sweden
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Overflow error, can't see why

    Hello! Thanks for your answer, unfortunatly I still get an overflow message in line:

    Please Login or Register  to view this content.
    Got to say there is quite a number of data, about 2900 rows in each sheet

    Quote Originally Posted by RHCPgergo View Post
    Hi,

    I'm not really sure, but maybe the offset property is causing the error? Does it work with using Cells in the first loop?
    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,626

    Re: Overflow error, can't see why

    What happens if you declare Klick as Long instead of Integer?

    In fact it might be an idea to change all the Integer declarations to Long.

  7. #7
    Registered User
    Join Date
    10-25-2011
    Location
    Norrköping Sweden
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Overflow error, can't see why

    I know changed the variable klick to a Long and didn't get overflow, so it seems to be working, thanks alot!

    Quote Originally Posted by Alexander_V View Post
    Hello! Thanks for your answer, unfortunatly I still get an overflow message in line:

    Please Login or Register  to view this content.
    Got to say there is quite a number of data, about 2900 rows in each sheet

  8. #8
    Registered User
    Join Date
    10-25-2011
    Location
    Norrköping Sweden
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Overflow error, can't see why

    Norie:
    Ye just thought of that too, maybe always having a long as declaration of big numbers. Thank you

+ 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