+ Reply to Thread
Results 1 to 7 of 7

Run only part of a macro for testing

Hybrid View

  1. #1
    Josh O.
    Guest

    Run only part of a macro for testing

    Is it possible to run only a portion of a macro?

    I am writing a long involved macro and I need to test each section to make
    sure it is producing the desired result before I write the next section of
    the macro. I was hoping I could run Section 1, write section 2, run section
    2 only, write section 3, run section 3 only...

    How can I do that?

  2. #2
    AA2e72E
    Guest

    RE: Run only part of a macro for testing

    Press F9 on the first line of the macro, hen run it: it will stop on that
    line. Press F8 to jump through the lines. If you hover the mouse pointer over
    any variable names above the cursor line, the values of those variables are
    shown as tooltips. Alternatively, query the variables in the Immediate
    Window. If you want to jump n lines below, click on the line you want to go
    to, click Debug, Select Set Next Statement and Press F5. If you want to stop
    altogether, click the reset icon on the standard toolbar.

    "Josh O." wrote:

    > Is it possible to run only a portion of a macro?
    >
    > I am writing a long involved macro and I need to test each section to make
    > sure it is producing the desired result before I write the next section of
    > the macro. I was hoping I could run Section 1, write section 2, run section
    > 2 only, write section 3, run section 3 only...
    >
    > How can I do that?


  3. #3
    arno
    Guest

    Re: Run only part of a macro for testing

    Hi Josh,

    > Is it possible to run only a portion of a macro?


    in the VBA Editor you'll find everything you need in menu "debug". (F8,
    F9, CTRL+F9.... F5)

    arno


  4. #4
    Chandra
    Guest

    Re: Run only part of a macro for testing


    why dont you write them if functions and call the functions.

    by this u can control what ever code u want in one go.

    best Regards,
    Chandra
    http://chanduas.blogspot.com/
    ---------------------------------------

    *** Sent via Developersdex http://www.developersdex.com ***

  5. #5
    Registered User
    Join Date
    07-25-2012
    Location
    West
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Run only part of a macro for testing

    Because I do this all the time in T-SQL and it is quick and easy.

  6. #6
    Don Guillett
    Guest

    Re: Run only part of a macro for testing

    sub mac1
    end sub
    sub mac2
    end sub
    sub runall
    mac1
    mac2
    end sub
    --
    Don Guillett
    SalesAid Software
    donaldb@281.com
    "Josh O." <JoshO@discussions.microsoft.com> wrote in message
    news:B687D7FF-41DB-40AB-BAA1-182FDDEDA0AA@microsoft.com...
    > Is it possible to run only a portion of a macro?
    >
    > I am writing a long involved macro and I need to test each section to make
    > sure it is producing the desired result before I write the next section of
    > the macro. I was hoping I could run Section 1, write section 2, run

    section
    > 2 only, write section 3, run section 3 only...
    >
    > How can I do that?




  7. #7
    Josh O.
    Guest

    Re: Run only part of a macro for testing

    Thanks Don.

    "Don Guillett" wrote:

    > sub mac1
    > end sub
    > sub mac2
    > end sub
    > sub runall
    > mac1
    > mac2
    > end sub
    > --
    > Don Guillett
    > SalesAid Software
    > donaldb@281.com
    > "Josh O." <JoshO@discussions.microsoft.com> wrote in message
    > news:B687D7FF-41DB-40AB-BAA1-182FDDEDA0AA@microsoft.com...
    > > Is it possible to run only a portion of a macro?
    > >
    > > I am writing a long involved macro and I need to test each section to make
    > > sure it is producing the desired result before I write the next section of
    > > the macro. I was hoping I could run Section 1, write section 2, run

    > section
    > > 2 only, write section 3, run section 3 only...
    > >
    > > How can I do that?

    >
    >
    >


+ 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