I have the following but it takes long time to run, it is a simple wherein the user select a file and data from Sheet1 is copied to another workbook.Sub ImportApp(ByVal filepath_Report As String, file_name1 As String, wsOutput As Worksheet)    Application.ScreenUpdating = False    Set wbReport = Workbooks.Open(file_name1)    Set wsReport = wbReport.Sheets(1)    Select Case wsOutput.Name        Case Is = Downtilt Tracker            wsReport.Activate            With Rows(1)                Set d = .Find(Completed Date)                If d Is Nothing Then                    MsgBox Invalid Down-Tilt Tracker. & vbNewLine & Please import a valid Down-Tilt Tracker.                    wbReport.Close False                    Sheets(Control).Activate                    Application.ScreenUpdating = True                    Exit Sub                End If            End With    End Select    wsReport.Activate: wsReport.Cells.Copy: wsOutput.Activate: Cells(1, 1).Select: ActiveSheet.Paste: Cells.EntireColumn.AutoFit: wsOutput.Range(A1:AB & 1048576).HorizontalAlignment = xlCenter    wsOutput.Cells(1, 1).Select    Application.CutCopyMode = False    wbReport.Close FalseEnd Sub
Copy data to another worksheet
performance;vba;excel
First things first - your code has some readability issues due to theuse of the colon operator:wsReport.Activate: wsReport.Cells.Copy: wsOutput.Activate: Cells(1, 1).Select: ActiveSheet.Paste: Cells.EntireColumn.AutoFit: wsOutput.Range(A1:AB & 1048576).HorizontalAlignment = xlCenterThis makes it incredibly difficult to tell at a glance what the codeis doing - reading down in a lot easier than reading left to rightwhen you are trying to work through a sequence.  This is much, muchbetter:wsReport.ActivatewsReport.Cells.CopywsOutput.ActivateCells(1, 1).SelectActiveSheet.PasteCells.EntireColumn.AutoFitwsOutput.Range(A1:AB & 1048576).HorizontalAlignment = xlCenterSecond, you have an unused variable in the Sub declaration -filepath_Report is never used.  I'd remove it.Speaking of your Sub declaration, it looks like the intent is to passall of the parameters by value, but in fact only the first parameteris passed by value - ByRef is the default and each parameter needsthe ByVal modifier to override the default.  The code belowdemonstrates:Private Sub ByValDemo()   Dim one As String, two As String   one = Variable one set in ByValDemo   two = Variable two set in ByValDemo   Call IsThisByVal(one, two)   Debug.Print one   Debug.Print twoEnd SubPrivate Sub IsThisByVal(ByVal one As String, two As String)   one = Variable one set in IsThisByVal   two = Variable two set in IsThisByValEnd Sub Debug output of running ByValDemo is:Variable one set in ByValDemo  Variable two set in IsThisByValTo declare both strings as ByVal (the Worksheet has to be ByRef), youneed to do this:Sub ImportApp(ByVal filepath_Report As String, ByVal file_name1 As String, wsOutput As Worksheet)The Select...Case structure is confusing as you only have one Case. Asimple If...Then would suffice.Although it probably isn't effecting anything, turning off screenupdates and then only turning it back on if your conditional executesprobably isn't the best way to handle it. Excel should turn it backon for you when the Sub exits, but I wouldn't rely on that.Per your comment, it seems like you are under the impression that youaren't using the Windows Clipboard. This isn't accurate.  The call towsReport.Cells.Copy puts the entire Worksheet on the clipboard. The.Cells property contains every possible cell in the worksheet (even unused). You can confirm this by running the following, opening Notepad and hitting Ctrl-V: Private Sub CanIHazClipboard()    Dim sheet As Worksheet    Set sheet = Application.ActiveSheet    sheet.Cells.Copy    'Prints 16384, regardless of what is being used.    Debug.Print sheet.Cells.Columns.count    'This would actually overflow the return variable...    'Debug.Print sheet.Cells.Rows.CountEnd SubThe Application methods such as .Select, .Activate,.Copy, and .Paste functions are really slow compared to using the objects that you already got references to.  Use the Rangeproperties instead:Dim target As Range'Set the paste range to the same cells as the source (needs to be the same size).Set target = wsOutput.Range(wsReport.UsedRange.Address)'If you need formulas...target.Formula = wsReport.UsedRange.Formula'...or if you only need to copy values.target.Value2 = wsReport.UsedRange.Value2This is not only incredibly faster, it doesn't trash the clipboard and you don't need to keep track of what is activated.You have an Exit Sub buried deep in a nested structure.  My personalrule is that if I'm going to bail out of a routine early, thatshouldn't happen at more than one level of indentation.  I wouldpersonally structure the flow control in this case so that it alwaysreaches the bottom of the Sub so you Don't Repeat Yourself with yourclean-up code (I also try to avoid the .Find method):Dim found As Boolean, cell As RangeIf Not wsOutput.Name = Downtilt Tracker Then    'I would assume this should also be an error condition...Else    For Each cell In wsOutput.UsedRange.Rows(1).Cells        If cell.Value2 = Completed Date Then            found = True            Exit For        End If    Next cell    If found Then        'Do your copy    Else        'Signal your error condition.        MsgBox Invalid Down-Tilt Tracker. & vbNewLine & _               Please import a valid Down-Tilt Tracker.    End IfEnd If'Only need the clean-up code once.Application.ScreenUpdating = TruewbReport.Close False