Results 1 to 7 of 7

Make code runs faster

Threaded View

YasserKhalil Make code runs faster 09-02-2015, 01:27 PM
ranman256 Re: Make code runs faster 09-02-2015, 02:25 PM
JOHN H. DAVIS Re: Make code runs faster 09-02-2015, 02:29 PM
AlphaFrog Re: Make code runs faster 09-02-2015, 02:34 PM
MrShorty Re: Make code runs faster 09-02-2015, 02:39 PM
YasserKhalil Re: Make code runs faster 09-02-2015, 03:41 PM
YasserKhalil Re: Make code runs faster 09-02-2015, 03:42 PM
  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Make code runs faster

    Hello everyone
    I have this code that works well but took a long time with large data
    Sub Test()
        Dim LR As Long, LRData As Long
        With Application
            .ScreenUpdating = False
            .DisplayAlerts = False
            .EnableEvents = False
            .Calculation = xlCalculationManual
        End With
    
        LR = Sheets("Balance").Cells(Rows.Count, "B").End(xlUp).Row
        LRData = Sheets("Data").Cells(Rows.Count, "B").End(xlUp).Row
    
        With Sheets("Balance")
            With .Range("E8:E" & LR)
                .Formula = "=SUMIFS(Data!R5C8:R" & LRData & "C8,Data!R5C1:R" & LRData & "C1,"">=""&Balance!R3C2,Data!R5C1:R" & LRData & "C1,""<=""&Balance!R4C2,Data!R5C2:R" & LRData & "C2,Balance!RC[-3])"
                .Value = .Value
            End With
            With .Range("F8:F" & LR)
                .Formula = "=SUMIFS(Data!R5C9:R" & LRData & "C9,Data!R5C1:R" & LRData & "C1,"">=""&Balance!R3C2,Data!R5C1:R" & LRData & "C1,""<=""&Balance!R4C2,Data!R5C2:R" & LRData & "C2,Balance!RC[-4])"
                .Value = .Value
            End With
        End With
    
        With Application
            .ScreenUpdating = True
            .DisplayAlerts = True
            .EnableEvents = True
            .Calculation = xlCalculationAutomatic
        End With
    End Sub
    Any ideas how to make it faster?
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Make this code more efficient and faster
    By SIMBAtheCAT in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2014, 10:45 AM
  2. [SOLVED] Make code Faster
    By zplugger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2013, 10:08 AM
  3. Make VBA code faster
    By Danielle22 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-28-2013, 09:01 AM
  4. Make the below code work faster!!!
    By devpp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2013, 06:13 AM
  5. [SOLVED] Ways to make my code run faster
    By JazzyBear in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2013, 03:59 PM
  6. [SOLVED] Make code run faster
    By ozhunter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2013, 04:26 AM
  7. Is it possible to get rid of this loop to make the code faster?
    By mhw1129 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2011, 09:03 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