Hi All,
Im having a little trouble with refining some vba in regards to a copy and paste performing slowly.
Here is what I am using:
If ws.Name Like "*Changes*" Then 'check if worksheet name contains Changes
ws.Activate
ActiveSheet.Columns("A:H").Select
Selection.Copy
ThisWorkbook.Worksheets("PasteHere").Activate
ActiveSheet.Range("A1").Select
ActiveSheet.Paste
ActiveSheet.Range("A1").Select
Workbooks(x).Close savechanges:=False
Application.DisplayAlerts = True
End If
Which runs slowly, probably becasue its copying the enitre columns.
Here is what I am attempting to use:
If ws.Name Like "*Changes*" Then
ws.Activate
Range("A:H").Copy
ThisWorkbook.Worksheets("PasteHere").Activate
ThisWorkbook.Sheets("PasteHere").UsedRange.Offset(1).Clear
ThisWorkbook.Sheets("PasteHere").Range("A" & Rows.Count).End(xlUp).Offset(0).PasteSpecial
Application.CutCopyMode = False
Range("A1").Select
Workbooks(x).Close savechanges:=False
End If
But I get a run time error 1004 on the line
ThisWorkbook.Sheets("PasteHere").Range("A" & Rows.Count).End(xlUp).Offset(0).PasteSpecial
What am I doing wrong?
Thanks!
Bookmarks