+ Reply to Thread
Results 1 to 2 of 2

Needed help in running the macro quickly

  1. #1
    Registered User
    Join Date
    09-26-2018
    Location
    Chennai, India
    MS-Off Ver
    2016
    Posts
    5

    Needed help in running the macro quickly

    Hi Folks,

    I am new here, Needed a very urgent help.

    I have developed a macro where it pulls the data from WorkBook 2 based on Criteria in Workbook 1. Macro is running fine but it takes more time to populate the data for me since the Workbook 2 *SERP DATA DUMP" is a 61 MB file.

    Can someone help me ASAP? as I need to present this one in tomorrow's meeting.

    Thanks in advance.

    Sub Filter&Paste()
    Dim wsData As Worksheet
    Dim wsMacro As Worksheet
    Dim sToFind As String
    Dim sFirstAddress As String
    Dim nr As Long, lr As Long
    Dim rFind As Range
    Set wsData = Workbooks("SERP Data Dump.xlsm").Sheets("Data")
    Set wsMacro = Workbooks("Preliminary SERP SOA template.xlsm").Sheets("FBL Data")

    lr = wsData.Range("F" & Rows.Count).End(xlUp).Row
    sToFind = wsMacro.Range("A1").Value
    nr = wsMacro.Range("A" & Rows.Count).End(xlUp).Row + 1
    Set rFind = wsData.Range("F1:F" & lr).Find(What:=sToFind)

    If rFind Is Nothing Then
    MsgBox sToFind & " could not be found in Column F", vbInformation, "Not Found"
    Exit Sub
    End If
    sFirstAddress = rFind.Address
    Do
    rFind.EntireRow.Copy
    wsMacro.Range("A" & nr).PasteSpecial xlPasteAll
    nr = nr + 1
    Set rFind = wsData.Range("F1:F" & lr).FindNext(After:=rFind)
    Loop Until rFind.Address = sFirstAddress
    Set rFind = Nothing
    Set wsData = Nothing
    Set wsMacro = Nothing

    Rows("3:3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Range("A3").Select
    End Sub

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Needed help in running the macro quickly

    Not sure somebody can help you ASAP as this is a FREE forum, but as soon as you update the title of your thread and add code tags, maybe then somebody can help.
    HTH
    Regards, Jeff

+ 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. OnTime running too quickly
    By seasider89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-15-2016, 01:20 PM
  2. Needed info before running macro
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-06-2013, 09:00 AM
  3. long running macro - progress indicator tips needed
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2012, 01:02 AM
  4. Empty Cell Needed Before Running Macro
    By josixpack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2012, 10:09 PM
  5. Statistics function needed quickly
    By epossible in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-09-2009, 02:01 PM
  6. Macro to go quickly to a sheet
    By Darin Kramer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2005, 10:05 AM
  7. [SOLVED] Mail Merging Help Needed. Quickly!
    By Lwotton in forum Excel General
    Replies: 1
    Last Post: 01-23-2005, 11:06 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