Results 1 to 15 of 15

Rewrite code to use less memory

Threaded View

  1. #1
    Registered User
    Join Date
    04-20-2015
    Location
    Norway
    MS-Off Ver
    360
    Posts
    24

    Rewrite code to use less memory

    I posted this problem a few days ago, here.
    Now that I understand the problem a little better, I知 posting it again (hopefully a little clearer)

    I have a macro that performes a simple task. It matches rows from sheet2 with rows in sheet1 if their respective value in column A match.
    However, when I have a lot of data, I get a memory error and can't run the code.

    This is an example of a smal dataset (the line that causes the error):
    Sub Merge_Data()
    'Merges the data (rows) with identical Unique-ID - Import from Sheet2 into Sheet1.
    
    Application.ScreenUpdating = False
            
            Temp = "" & "I" & "1:" & Cells(10, 13).Address
            Sheets("Sheet1").Range(Temp).FormulaR1C1 = _
                    "=OFFSET(Sheet2!R1C[" & -8 & "],MATCH(RC1,Sheet2!R1C1:R" & 10 & "C1,0)-1,0)"
    
    Application.ScreenUpdating = True
          
    End Sub
    My question: Is there a way to break this up into several separate operations?
    E.g. first find matches for row 1 and 2, then row 3 and 4, etc.

    I知 stuck, so I appreciate all feedback!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. rewrite advaced filter code in shorter simpler vba
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-26-2016, 01:47 PM
  2. To use the code rather than rewrite
    By gan_xl in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2015, 04:53 AM
  3. How do I rewrite this code to maintain the cell format?
    By Bran99 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2015, 04:00 PM
  4. rewrite the existing code for charts
    By csunilkumar in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-14-2014, 12:49 AM
  5. [SOLVED] Is there a way to rewrite this code for a UserForm in loop form?
    By bananajelly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-07-2014, 01:21 PM
  6. [SOLVED] Looking for help with speeding up or rewrite on vba code.
    By ukchris74 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-16-2013, 01:54 PM
  7. [SOLVED] Outlook 2010: Rewrite VBA Code
    By Cansa in forum Outlook Formatting & Functions
    Replies: 3
    Last Post: 10-12-2012, 12:25 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