+ Reply to Thread
Results 1 to 5 of 5

debugging in loop

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    debugging in loop

    Hi,

    I would like to check wheter a certain part of a macro is without bugs. The problem is that if the part i want to check is in row 35 i have to press F8 for a long time before getting at the point i want to check. In what way can i do this faster?

    Any input is much appreciated!

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: debugging in loop

    Hi,

    Put the cursor at row 35 and then hit F9 to insert a breakpoint. The macro will stop at breakpoint for debugging.
    ❖ Please mark your thread is SOLVED if there has been offered a solution that works fine for you.

    ❖ If you like solutions provided by anyone, feel free to add reputation by clicking on ✶ Add Reputation bottom left of their posts.

  3. #3
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    Re: debugging in loop

    Thank you for your advice but i mean that if you have a loop with 35 rows in a column in a spreadsheet with if then statements, i would like the script to stop at row 35 so i can run each line of code with F8.

  4. #4
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: debugging in loop

    Assume you want to debug when variable i = 35, click Debug - Add Watch..., type i = 35 into Expression box and select Break When Value Is True and then click OK.

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: debugging in loop

    Another option is to use debug.assert like
    Please Login or Register  to view this content.
    which will stop when i=35

+ 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] Macro exits outer loop early in normal run, works fine in debugging mode
    By Patrick90 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2016, 06:13 PM
  2. Replies: 3
    Last Post: 09-29-2014, 09:55 PM
  3. [SOLVED] Loop prevents debugging
    By bibu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-23-2014, 02:25 PM
  4. Nested Loop to highlight changes, any help debugging MUCH appreciated!
    By flintcs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2013, 10:02 PM
  5. Debugging and Loop issue
    By harshjog123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-05-2012, 07:58 PM
  6. help with debugging
    By akhlaq768 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2008, 05:15 AM
  7. loop does not work except in debugging step through mode
    By Nicole B in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2005, 01:06 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