+ Reply to Thread
Results 1 to 3 of 3

Make Copy/Paste Values Macro more efficient when calculating

  1. #1
    Registered User
    Join Date
    06-10-2013
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2011 Mac
    Posts
    50

    Make Copy/Paste Values Macro more efficient when calculating

    I got a macro to copy and paste values onto another tab within my worksheet. I have a lot of data and currently takes about 30 seconds to calculate and paste. Not sure if its an issue with my macro or with my computer (Mac - Excel 2011).

    Here is an example of my macro:

    Sub SimulateWeek()

    If Range("AdvanceWeek").Value = "Week 1" Then
    Range("Week1B").Copy
    Sheets("Schedule - Results").Range("C2").PasteSpecial Paste:=xlPasteValues
    ElseIf Range("AdvanceWeek").Value = "Week 2" Then
    Range("Week1B").Copy
    Sheets("Schedule - Results").Range("C515").PasteSpecial Paste:=xlPasteValues
    ElseIf Range("AdvanceWeek").Value = "Week 3" Then
    Range("Week1B").Copy
    Sheets("Schedule - Results").Range("C1028").PasteSpecial Paste:=xlPasteValues
    ElseIf Range("AdvanceWeek").Value = "Week 4" Then
    Range("Week1B").Copy
    Sheets("Schedule - Results").Range("C1538").PasteSpecial Paste:=xlPasteValues
    ElseIf Range("AdvanceWeek").Value = "Week 5" Then
    Range("Week1B").Copy
    Sheets("Schedule - Results").Range("C2048").PasteSpecial Paste:=xlPasteValues
    ...
    End Sub

    (this continues on until 'ElseIf Range("AdvanceWeek").Value = "Week 31"....etc). So you can see I have the same code repeated 31 times. Let me know if this can be condensed to help with the calculating performance. Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Make Copy/Paste Values Macro more efficient when calculating

    It might be better if you upload your workbook. There may be better ways to achieve your results and may even be better ways to organise your data.

    Tell us what the ultimate goal is here.

    Also please note the forum rules about enclosing procedures in CODE tags
    Last edited by Richard Buttrey; 02-17-2014 at 07:14 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    06-10-2013
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2011 Mac
    Posts
    50

    Re: Make Copy/Paste Values Macro more efficient when calculating

    im not sure if i uploaded my workbook it would be easy to follow. im making a college basketball simulation game, where it tracks all games and records, etc...

+ 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] What is the most efficient way to copy, paste and transpose values between worksheets?
    By fredrs05 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2013, 03:51 PM
  2. More efficient script for insert new worksheets, copy and paste values?
    By SDBoca in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2011, 11:07 AM
  3. Copy & Paste code more efficient
    By Desert Piranha in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-15-2006, 11:51 PM
  4. More efficient copy/paste??
    By Celt in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-09-2006, 02:25 PM
  5. [SOLVED] Efficient Copy/Paste
    By William Benson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-08-2005, 03:05 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