+ Reply to Thread
Results 1 to 3 of 3

how to stop running vba code without loosing printed data on the sheet?

  1. #1
    MCM
    Guest

    how to stop running vba code without loosing printed data on the sheet?

    hi everybody,

    I have a small problem. Is there anyway to stop a running vba excel
    code without loosing the printed data up to stopping time? i.e. I want
    to stop program and then check some results , is it possible?

    thanks.


  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    look up some of the Debug features either a BREAKPOINT or a WATCH might help as these do not stop the code but just suspend it. After checking your values the code can continue from where it stopped.

    (or a STOP statement)

    eg if myval="ABC" then stop

    hope this helps

  3. #3
    AA2e72E
    Guest

    Re: how to stop running vba code without loosing printed data on t

    Also try:

    Alt + F11
    Locate the Function or Sub you are interested in, and then the line you want
    to stop at. Press F9
    Click View | Immediate Window

    When the code runs (F5), it iwill stop on the line at which you pressed F9.
    All the variables are available for interrogation: in the Immediste window
    type
    ?VarName
    to see its content

    ?Vartype(VarName)

    tells you the type of the variable

    ?Typename(VarName)

    tells you the TYPE of the variable

    PS: VarName above is your variable name.

    Press F8 to execute one line at a time.

    As suggested, learn to use the Debug option in the VBE.


+ 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