+ Reply to Thread
Results 1 to 6 of 6

Running Macro With Loop

  1. #1
    Registered User
    Join Date
    12-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    28

    Running Macro With Loop

    Hello,

    I'm trying to make a macro that will pull data from a reference worksheet, concatenate that new data, rename the file to the concatenated cell value, save the file, delete the reference worksheet row that has already been used, then run the macro again until the reference worksheet is empty.

    My macro works for everything except for the loop. I can run it over and over manually and it works great, I'm just hoping to run it once and have it run 60+ times by itself.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated. Thanks in advance.

  2. #2
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Running Macro With Loop

    What determines how many times you need it to run?
    If you find the suggestion or solution helpful, please consider adding reputation to the post.

  3. #3
    Registered User
    Join Date
    12-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Running Macro With Loop

    The reference worksheet has a finite number of rows with data. Running the macro pulls the data from row 2 of the reference worksheet to another worksheet, pastes the values and then deletes row 2 of the reference worksheet before saving the file. In essence, the reference worksheet values will move up one row every time the macro runs until there isn't any data in row 2 of the reference worksheet.

  4. #4
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Running Macro With Loop

    Maybe give this a try: not tested.. but something to look at and see if it will help or work.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Running Macro With Loop

    I had to change the order of two parts of my code, but this appears to have worked perfectly! Thanks for your help, I really appreciate it.
    Last edited by Shawn1888; 08-24-2021 at 05:49 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    05-15-2017
    Location
    US
    MS-Off Ver
    365
    Posts
    901

    Re: Running Macro With Loop

    If it helped, consider adding reputation to the post that helped..and your welcome glad it helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel not responding after running a macro with a loop [HELP]
    By soula1998 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2020, 06:28 PM
  2. Excel is hanging or freezing while running macro but macro still running.
    By Atik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-17-2018, 03:48 AM
  3. Changing a macro into a running loop
    By Murat Cypriot in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2016, 04:43 PM
  4. Running Macro with Do Loop of similar based on values in a Column
    By fishycarl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 03:50 AM
  5. Running One Macro in Multiple Worksheets & Loop
    By mjali001 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-10-2011, 04:57 PM
  6. Loop in my macro doesn't seem to be running; however, it compiles fine...
    By Goobies in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2006, 09:00 PM

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