+ Reply to Thread
Results 1 to 5 of 5

Macro will Only run once

  1. #1
    Forum Contributor
    Join Date
    10-28-2009
    Location
    Portland, Maine
    MS-Off Ver
    Excel 2003
    Posts
    102

    Macro will Only run once

    Hello,
    This is a repost of closed thread with what is hopefully a better description of what I'm working on.

    I have a spreadsheet that I'm using to build a table with named ranges.

    The simple explaination of the issue is that the code runs once and will not run again (macro = AddValues).

    If I step through the same code it works fine but when I actually run it it won't run the second time. If I close and re-open it still will not run.

    Also, if I run one of two other macros (macros = OverRide or DeleteProvider) and then try to run the AddValues program it won't work then either.

    By themselves the code all seems to do what it's supposed to do but I'm not sure why it only runs once or why the same code works when I step through it or run it with breakpoints inserted.

    The pimary code that I'm having an issue with is:
    Attached Files Attached Files
    Last edited by yunesm; 11-22-2011 at 02:09 PM.

  2. #2
    Forum Contributor
    Join Date
    10-28-2009
    Location
    Portland, Maine
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: Managing Named Ranges

    Hello,
    I am adding to this thread with what is hopefully a better description of what I'm working on...

    I have a spreadsheet that I'm using to build a table with named ranges.

    The simple explaination of the issue is that the code runs once and will not run again (macro = AddValues).

    If I step through the same code it works fine but when I actually run it it won't run the second time. If I close and re-open it still will not run.

    Also, if I run one of two other macros (macros = OverRide or DeleteProvider) and then try to run the AddValues program it won't work then either.

    By themselves the code all seems to do what it's supposed to do but I'm not sure why it only runs once or why the same code works when I step through it or run it with breakpoints inserted.

    The pimary code that I'm having an issue with is: (same as above)

    I'm sure that I'm doing something stupid but I can't or I'm too tired to find it! Wondering if anyone could take a look at the code. To keep the length of the post to a minimum I only added teh AddValues code. The other programs are available in the attached sample file.

    Any help would be greatly appreciated!

    Thanks!

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro will Only run once

    Hi yunesm

    Move this line of code...see if that helps
    Please Login or Register  to view this content.
    I don't know why but it appears to work.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    10-28-2009
    Location
    Portland, Maine
    MS-Off Ver
    Excel 2003
    Posts
    102

    Re: Macro will Only run once

    Hey John!
    Thanks for taking a look at this I really appreciate it. You're right this seems to take care of it. I don't know why that changes this but at this point I'm not going to worry about it.

    Thanks again for your help.
    Thanks!

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Macro will Only run once

    Hi yunesm
    You're welcome...glad I could help.

+ 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