+ Reply to Thread
Results 1 to 6 of 6

Code unable to debug, how to run continuously?

  1. #1
    Registered User
    Join Date
    06-10-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    37

    Code unable to debug, how to run continuously?

    Hey guys! I have outlined my code below.

    So basically I have two different things happening here, one part is hiding rows based off of a selected dropdown setting, the next hides/shows pictures of signatures based off of a name selection dropdown. I know both of these pieces of code work, but for some reason I can't get them to run continuously, and I can't even debug them, f8 doesn't allow me to run through them. Any idea why? Any help would be appreciated. Thanks guys!

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,179

    Re: Code unable to debug, how to run continuously?

    Put the word Stop as the first line of code in the Change event handler. Then, when you make a change, it will stop and you can use F8 to step through the code.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-10-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    37

    Re: Code unable to debug, how to run continuously?

    TMS,

    If I put the word stop there, will this run continuously? I basically need this running in the background at all times so when the selection is made, it will still update. Could explain more as to where the "change event handler is"?
    Thanks for the help.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,179

    Re: Code unable to debug, how to run continuously?

    Please Login or Register  to view this content.
    If you have a Worksheet Change event handler, such as your code, it will fire for EVERY change made on the worksheet. It's then up to you to decide whether or not you are interested in the change that has been made. And, if you are, what do you want to do about it.

    So, yes, the Worksheet Change event handler will (does) run continuously but, for diagnostic purposes, the Stop statement will halt execution so that you can step through and see what is happening. However, what IS happening is that for each and every change made to ANY cell on the worksheet, the event will fire and check the values of certain Named Ranges. It will then hide or unhide specific rows.

    The code looks a little repetitive and not very scaleable but I'm sure it does what you want.

    Regards, TMS

  5. #5
    Registered User
    Join Date
    06-10-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    37

    Re: Code unable to debug, how to run continuously?

    Thank you so much, you've seriously been so much help, thanks for explaining it to me. I managed to get it working, do I have a clue how? Absolutely not. It just started working for some reason and I don't even know what I changed. The explanation you gave was very thorough though and I appreciate that, keep up the good work!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,179

    Re: Code unable to debug, how to run continuously?

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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. Error in the code please debug it
    By kalyaaans in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 09-22-2014, 10:28 AM
  2. Coming a debug "unable to get the OLEObjects property of the worksheet class
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-07-2014, 02:33 AM
  3. VBA Code Runs in Debug Mode But Returns Type Mismatch Error Outside Debug Mode
    By valerie.k.chiang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2014, 03:48 PM
  4. [SOLVED] Debug: How to debug this code?
    By reach78 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-25-2013, 07:16 AM
  5. [SOLVED] Runtime error...53; unable to debug
    By vinay.kottur in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2013, 01:34 PM
  6. Debug the Code
    By macrogeek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2011, 06:45 AM
  7. HELP, trying to debug this code...
    By twofootgiant in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2011, 12:05 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