Closed Thread
Results 1 to 1 of 1

Speed up macro

Hybrid View

Duncan1 Speed up macro 04-03-2007, 09:46 PM
  1. #1
    Registered User
    Join Date
    01-06-2007
    Posts
    29

    Speed up macro

    Closed . Code not wrapped

    I am trying to speed up this macro that I have. Maybe get rid of the Activation and Select. And any other methods to speed it up will be greatly appreciate. Here is the code in question:


    Sub AllFolderFiles()

    Application.DisplayAlerts = False
    Dim wb As Workbook
    Dim TheFile As String
    Dim MyPath As String

    MyPath = "C:\Documents and Settings\Owner\Desktop\upperdata300Loop"
    ChDir MyPath
    TheFile = Dir("*.xlsx")
    Do While TheFile <> ""


    Set wb = Workbooks.Open(MyPath & "\" & TheFile)
    wb.Activate
    Range("a1").CurrentRegion.Copy
    wb.Close
    Range("a2").Select
    ActiveSheet.Paste


    ActiveSheet.Range("$A$1:$PG$1643").AutoFilter Field:=6, Criteria1:="1"
    Range("a1").CurrentRegion.Copy
    Windows("results.xlsx").Activate
    Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).Select
    ActiveSheet.Paste
    Windows("UpperCompare 001.xlsx").Activate
    ActiveSheet.Range("$F$1:$ATG$500").AutoFilter Field:=6
    Range("A2:D400").Select
    Selection.ClearContents


    TheFile = Dir
    Loop
    End Sub
    Last edited by VBA Noob; 04-04-2007 at 01:47 AM.

Closed Thread

Thread Information

Users Browsing this Thread

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

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