Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    China, Maine, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    stepping through a macro (Excel 2000)

    Can anyone tell me how to get a macro to run one step at a time, so I can see what it's doing on the spreadsheet at each step? I used to be able to go in and step through a macro and watch it work, but that doesn't seem to be possible anymore. All I seem to be able to do is step through the actual Visual Basic code, without being able to see the effects on the original spreadsheet. Has the command changed in recent years?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: stepping through a macro (Excel 2000)

    F8 steps thru the code. Keep the VB window not full screen so you can see the worksheet in the background and also see the VB window.
    Also if you turn screenupdating off in the code (application.screenupdating = false) you must comment out this line (add an apostophe (') before the line of code) or you will not see it update

    Steve

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Location
    China, Maine, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: stepping through a macro (Excel 2000)

    Thanks, Steve! That did the trick. I knew about the F8 to step through, but I hadn't thought to make the window smaller so I could see what was going on in the spreadsheet.

    Ah, these little tidbits of information make all the difference!

  4. #4
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    Long Beach, California, USA
    Posts
    233
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: stepping through a macro (Excel 2000)

    Charlie,

    I find it helpful to have the Locals window visible so I can see, as I step thru my code, what each variable is doing.

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: stepping through a macro (Excel 2000)

    And those little tooltips are rather handy for the same purpose, when you hold the mouse pointer over your code while the macro is paused.

    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •