+ Reply to Thread
Results 1 to 2 of 2

Call Macros before Next loop (loop creates new worksheets)

  1. #1
    Registered User
    Join Date
    10-21-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Call Macros before Next loop (loop creates new worksheets)

    Hello!

    I have used a macro that creates new worksheets, and imports template formatting into each new sheet.

    However, I also want to run a few macros that handle variable data that will be customized for each new sheet, before moving the the Next loop and creating a new sheet.

    Here is my code

    Please Login or Register  to view this content.


    Each one of these macros works fine individually, but getting them to work properly on a new sheet (before the creation of the next sheet) is eluding me. I will post the code for other macros if necessary. Or you can check out the attached file.

    The file opens to the data tab, which has a button to execute the macro. Once executed, the newly created sheets can be deleted and the macro attempted again.

    If I can integrate all this code, it will make life much easier.

    Any advice is appreciated!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    10-21-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Call Macros before Next loop (loop creates new worksheets)

    Please disregard, I solved the problem myself.

    This line of code
    With ActiveSheet
    .Range("B4").Value = .Name
    End With

    Had to be moved before the subsequent Macros could be called.

+ 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