+ Reply to Thread
Results 1 to 7 of 7

need help correcting a macro-run-time erro 6 - overflow

  1. #1
    Registered User
    Join Date
    03-27-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2003
    Posts
    13

    need help correcting a macro-run-time erro 6 - overflow

    Dear Excel Expert,

    I created the following macro to run on a selected range, but if I select for example five cells in a column the macro does not stop at the fifth selection but continues to the very end of the list. I arbitrarily set the do until to .1 because I did not want the "do loop" to stop the macro but rather the other loop to stop it. I think this might be the problem though. And sometimes the macro doesn't run at all but gives me a Run-Time error - 6 - overflow.

    Please help. Thanks Andrew
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 04-26-2013 at 01:25 PM. Reason: Added Code Tags

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: need help correcting a macro-run-time erro 6 - overflow

    the best calculation for the last row used is

    Please Login or Register  to view this content.
    selecting a column that is continuously filled up until the end.
    Last edited by Leith Ross; 04-26-2013 at 01:26 PM. Reason: Added Code Tags

  3. #3
    Registered User
    Join Date
    03-27-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: need help correcting a macro-run-time erro 6 - overflow

    Thank you rcm for the reply. Where in the macro do I insert your suggested correction. And do I need to delete any of my lines?

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: need help correcting a macro-run-time erro 6 - overflow

    your problem is deeper than I thought... my original reply is not part of the solution...

    if the range is entered like "A1:a5" then the starting row and ending rows can be established...otherwise

  5. #5
    Registered User
    Join Date
    03-27-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: need help correcting a macro-run-time erro 6 - overflow

    Hi rcm,

    Thanks for the reply. I figured out the error. I changed the loop to a for next loop and now it works well.

    Can I ask you a separate question is it possible to copy color coding of text from one list of names to another, ie one column of names has color formatting and the other doesn't so I need to copy from the color coded list to the non-color coded list.

    Thanks again,

    Andrew

  6. #6
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: need help correcting a macro-run-time erro 6 - overflow

    in VBA yes let assume you want to copy the font color of cells(1,"A") into cells(1,"D").

    cells(1,"A").font.color=cells(1,"D").font.color

  7. #7
    Registered User
    Join Date
    03-27-2013
    Location
    Arizona
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: need help correcting a macro-run-time erro 6 - overflow

    Hi rcm,

    I tried that line of code but could not get it to work. Could you please put it in a short macro so that I know for sure I am using it correctly?

    Thanks,

    Andrew

+ 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