+ Reply to Thread
Results 1 to 4 of 4

Debug on Worksheet_change event

  1. #1
    Registered User
    Join Date
    06-01-2016
    Location
    Singapore
    MS-Off Ver
    13
    Posts
    55

    Debug on Worksheet_change event

    Hi,

    I am starter in VBA. Please suggest how do i debug worksheet_change events.

    In VBA, debugging modules is straight foward using F8. But when I press F8 on changevents nothing happens. Whats the best way to see the flow from worksheet_change events to other modules?

    Thanks in Advance

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Debug on Worksheet_change event

    That is a good question that I would also like the answer to. Here is what I do in that situation..
    Remove a letter from a line at the beginning of your code
    Do something on the worksheet to trigger the Change event. This will cause the code to error out on the line you removed the letter from.
    Correct the line, then you can F8 through the rest of the lines.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,515

    Re: Debug on Worksheet_change event

    Stop statement: https://msdn.microsoft.com/en-us/lib.../gg264373.aspx Putting a Stop statement where you want the code to stop and enter debug mode allows you to call the event procedure by triggering the event, and enter debug mode. I often put a Stop statement right at the beginning of such a procedure so I can see what data got passed to the procedure. When your procedure is all debugged, then you can clear or comment out all the stop statements.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    06-01-2016
    Location
    Singapore
    MS-Off Ver
    13
    Posts
    55

    Re: Debug on Worksheet_change event

    Thank you. That helped!!

+ 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. How do I use the worksheet_change event?
    By JohnJK04 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2015, 07:51 PM
  2. Worksheet_Change event
    By serge.pigeot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-25-2012, 03:20 AM
  3. Worksheet_Change Event won't run more than once
    By David McMillon in forum Excel General
    Replies: 2
    Last Post: 07-08-2010, 04:02 PM
  4. Using Worksheet_Change Event
    By John99 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2009, 08:26 AM
  5. Worksheet_Change Event
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-24-2009, 04:45 AM
  6. Worksheet_Change Event
    By safflenow in forum Excel General
    Replies: 1
    Last Post: 06-27-2005, 01: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