Results 21 to 40 of 80

Thread: Need help gettin this macro to run faster, Please!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location

    Need help gettin this macro to run faster, Please!

    Option Explicit 
     
    [Sub test() 
        Dim g As Range, k As Range 
        Dim s, e 
         
        For Each g In Range("g1", Range("g1").End(xlDown)) 
            For Each k In Range("k1", Range("k1").End(xlDown)) 
                s = Split(g.Value, "-") 
                For Each e In Split(k.Value, "-") 
                    s = Filter(s, e, False) 
                Next 
                If UBound(s) < 2 Then 
                    Union(g, k).Interior.Color = vbRed 
                End If 
            Next 
        Next 
         
    End Sub]
    so the data in G could have over 200,000 entries the data in column K over 400,000 entries.

    how can this be written to run faster, I added the Application.Screenupdating =False so I can interrupt it by hitting hittinght ESC key but even that doesn't stop it when its running.
    so toavoid doing this I need this to run faster


    I appreciate any help on this!

    Thank you
    Last edited by estatefinds; 03-06-2017 at 12:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •