+ Reply to Thread
Results 1 to 4 of 4

Help with Macro! Overflow Error

  1. #1
    Registered User
    Join Date
    09-12-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Help with Macro! Overflow Error

    Hi All,

    I've been browsing through a lot of these Overflow error threads and after countless hours of reading and trial and error, I can't seem to get my macro to work.

    I should probably say that this is for one of my studies looking at heart rate variability (inter-beat interval [IBI], measure in milliseconds) data during sleep following a stress task.

    I'm trying to do the following:
    1. Map IBI data (in ms) to actual time of study phases.
    2. Break the phases into segments (on sheet 2)
    3. Export these IBI segments into .txt files so that each .txt file contains only those IBIs that match the time segments

    I've adapted a Macro from a previous study, and it works.... up until Sleep3 phase of the study...

    Not sure why it's working for half of my data but not for the other half. I get a "Overload" error. I changed the variable type to "Long" so it should be working...

    I've attached the excel file with the Macro in it.

    Any suggestions guys? I'd really appreciate it.

    Thanks!!!

    Abdiel
    Attached Files Attached Files
    Last edited by Abdiel; 09-12-2013 at 11:05 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,428

    Re: Help with Macro! Overflow Error

    you defined a variable, to hold row position, as Integer, which only goes to 32,767
    it needs to be defined as Long

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    09-12-2013
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Help with Macro! Overflow Error

    Worked perfectly! Thanks!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,675

    Re: Help with Macro! Overflow Error

    Welcome to the Forum Abdiel!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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. Issue in macro getting overflow error
    By expert40 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2013, 11:43 AM
  2. Run Time Error '6' Overflow - Macro That Find Text and Copy Range & Replace on Other Sheet
    By asgharhussaini in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2013, 04:34 AM
  3. Overflow Error - Faster way of copying through macro
    By c.vaibhav in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-02-2009, 06:45 PM
  4. runtime error 6 overflow when running a macro
    By Kim in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2006, 12:45 PM
  5. [SOLVED] overflow error 6.. the macro just stops any idea why?
    By ste mac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-07-2005, 12:06 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