+ Reply to Thread
Results 1 to 4 of 4

Macro Stepping

  1. #1
    George
    Guest

    Macro Stepping

    When stepping through a macro where values are being changed ( e.g.as in a
    loop) is it possible to "see" the current values.

    For Example :-

    For x= 1 to 19
    For y = x+1 to 20
    If Cells(x,2) = Cells (y,2) Then ' do something'
    next y
    next x

    I would like to be able to see the values of x & y in the VBA pane as I step
    through th macro.

    Reagrds
    George




  2. #2
    Norman Jones
    Guest

    Re: Macro Stepping

    Hi George,

    Try using the Locals Window to see all variables. Alternatively, open the
    Watch Window and add thr required variables or expressions.

    Either window may be opened from the View menu.


    ---
    Regards,
    Norman


    "George" <nz@mbeb.co.za> wrote in message
    news:e7g5jm$ph7$1@ctb-nnrp2.saix.net...
    > When stepping through a macro where values are being changed ( e.g.as in a
    > loop) is it possible to "see" the current values.
    >
    > For Example :-
    >
    > For x= 1 to 19
    > For y = x+1 to 20
    > If Cells(x,2) = Cells (y,2) Then ' do something'
    > next y
    > next x
    >
    > I would like to be able to see the values of x & y in the VBA pane as I
    > step through th macro.
    >
    > Reagrds
    > George
    >
    >
    >




  3. #3
    Andrew Taylor
    Guest

    Re: Macro Stepping

    If you hover your mouse pointer over the variable name you'll see the
    value displayed.



    George wrote:
    > When stepping through a macro where values are being changed ( e.g.as in a
    > loop) is it possible to "see" the current values.
    >
    > For Example :-
    >
    > For x= 1 to 19
    > For y = x+1 to 20
    > If Cells(x,2) = Cells (y,2) Then ' do something'
    > next y
    > next x
    >
    > I would like to be able to see the values of x & y in the VBA pane as I step
    > through th macro.
    >
    > Reagrds
    > George



  4. #4
    NickHK
    Guest

    Re: Macro Stepping

    George,
    As well as the other replies, you can print to the Immediate window. e.g.
    Debug.Print "x=" & x, "y= & y

    NickHK

    "George" <nz@mbeb.co.za> wrote in message
    news:e7g5jm$ph7$1@ctb-nnrp2.saix.net...
    > When stepping through a macro where values are being changed ( e.g.as in a
    > loop) is it possible to "see" the current values.
    >
    > For Example :-
    >
    > For x= 1 to 19
    > For y = x+1 to 20
    > If Cells(x,2) = Cells (y,2) Then ' do something'
    > next y
    > next x
    >
    > I would like to be able to see the values of x & y in the VBA pane as I

    step
    > through th macro.
    >
    > Reagrds
    > George
    >
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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