+ Reply to Thread
Results 1 to 7 of 7

Speed up Macro Loop

  1. #1
    Registered User
    Join Date
    09-19-2012
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    29

    Speed up Macro Loop

    Excel Help.Clean.xlsmExcel Help.Clean.xlsmHey everyone,

    I'm looking for a better way to increase the speed of the macro code (referenced below). I was just curious if there were any other formulas or tricks I could use. It currently performs a loop bw every cell in a range C2:F32. It takes about 10 seconds on average for every score aka "macro run" to transfer over. It currently isn't that bad with the # of questions I have, but I'm working on a project where I would need to add additional questions, and I'm thinking that the 10 seconds for every questions may become cumbersome. Any help would defiantly be appreciated it!



    "Sub MacroLog()

    Dim rcell As Range

    For Each rcell In Sheets("Scoring").Range("C2:F32")

    If rcell.Value = "" Then

    Sheets("Scoring (2)").Cells(rcell.Row, rcell.Column).Copy
    rcell.PasteSpecial xlFormulas

    End If

    Next rcell

    Sheets("Scoring").Select
    Range("C2:F32").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("Response Tool").Select
    Range("C5").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("D1").Select
    End Sub"
    Last edited by jbench18; 07-30-2013 at 06:22 PM. Reason: Adding excel file for review

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Speed up Macro Loop

    Please Login or Register  to view this content.
    Last edited by stnkynts; 07-30-2013 at 02:24 PM.

  3. #3
    Registered User
    Join Date
    09-19-2012
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Speed up Macro Loop

    Thanks for the quick response! The macro works perfect, and QUICK for the 1rst action / click. When you attempt to answer subsequent questions the macro gives a user error for the following line:

    For Each rcell In Sheets("Scoring").Range("C2:F32").SpecialCells(xlCellTypeBlanks)

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Speed up Macro Loop

    It is not clear to me what you are trying to do.

  5. #5
    Registered User
    Join Date
    09-19-2012
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Speed up Macro Loop

    I've added the file I'm working with to better give you an idea of what I'm trying to do.

    Cell C5 on "Response Tool" tab is where the person will go and provide a score to a response (list range: 1-5). The macro will copy and paste this score after to another worksheet. The person will continue to answer another question (Cell C3:drop down box) and / or answer the same question for a different supplier (Cell C4: drop down box). This will continue until all the questions are answered for all the suppliers. Let me know if you need me to clarify anything...thanks for the help.

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Speed up Macro Loop

    I am still having difficulty understanding whats going on but I think that is because you are approaching the problem from a different angle than I would. Assign this macro to the log button and see if it transfers the data to the scoring sheet like you want

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-19-2012
    Location
    CT
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Speed up Macro Loop

    That is EXACTLY what I'm working for. I did a quick trial, and it worked perfect. I need to make some cosmetic changes (but I can do those myself). THANK You very much for the help! Much appreciated!

+ 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. [SOLVED] Speed Up Loop in VBA
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-19-2013, 08:57 AM
  2. [SOLVED] Help Speed up this Loop?!?
    By arleutwyler in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-06-2013, 01:49 AM
  3. Speed Up VBA Loop Code
    By rlsublime in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 12-30-2012, 07:20 PM
  4. [SOLVED] Speed up slow macro loop
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-15-2012, 11:41 AM
  5. Run-time error '13' on Loop + Speed up macro
    By GeorgY in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-05-2009, 11:19 AM

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