+ Reply to Thread
Results 1 to 4 of 4

How to stop macro from looping

  1. #1
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Surrey B.C.
    MS-Off Ver
    2013
    Posts
    155

    How to stop macro from looping

    This macro runs upon opening of my book.

    This Macro is supposed to allow all sheets in the work book to run ALL MACROS while in protected mode, then ask if I want to open up two other books.

    When it runs it continually loops.

    Can someone help me troubeshoot. I am not certain what is wrong.

    Here is the code.

    Please Login or Register  to view this content.
    Any help would be appreciated

  2. #2
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Re: How to stop macro from looping

    You've got:

    Please Login or Register  to view this content.
    in the loop of every worksheet. So you're opening a worksheet and doing this for every single worksheet.

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: How to stop macro from looping

    Hi,
    Just a little advice
    Please Login or Register  to view this content.

    Don't hard code paths in your code, use variables or a dialog to select the file, this avoid you needing to modify your code if another file is required.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  4. #4
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Surrey B.C.
    MS-Off Ver
    2013
    Posts
    155

    Re: How to stop macro from looping

    That was the trick thank you

+ 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. [SOLVED] How to stop looping in windows 7
    By mohan.r1980 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2016, 07:16 AM
  2. Stop looping at a specific sheet
    By Bpd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2013, 11:03 PM
  3. [SOLVED] Stop looping
    By cdafonseca in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2013, 11:13 PM
  4. [SOLVED] Stop Message Box looping when OK is selected
    By connieb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2013, 04:40 PM
  5. How to stop a looping macro with a macro?
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-26-2011, 05:37 PM
  6. How to stop Macro from looping
    By cooh23 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-27-2007, 01:05 PM
  7. [SOLVED] Do Loop Won't Stop Looping
    By Lost in Alabama in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-22-2006, 08:30 PM

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