Hi,
I need to pull some data from different columns to another excel file. The following is my code:
The code works perfectly fine, just that I have a lot of data to pull (the above are just 2 of the data to be pulled, therefore when I run the code, it will keep activating Database file every time when it pulls from a new column, which makes my laptop to slow down, and even worse, Excel will crash. So I am wondering if there is any way to stop activating the Database file for each time?
I have tried doing the code shown below, but it gives me an error saying Select Method of range class failed (highlighting the first line):
Hope to receive help as soon as possible
I need to pull some data from different columns to another excel file. The following is my code:
VBA Code:
Sub TestPull()
Workbooks("Database.xlsm").Worksheets("Overall").Activate
Range("E5").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy _
Workbooks("Framework.xlsm").Worksheets("NEW").Range("A5")
Application.CutCopyMode = False
Workbooks("Database.xlsm").Worksheets("Overall").Activate
Range("G5").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy _
Workbooks("Framework.xlsm").Worksheets("NEW").Range("B5")
Application.CutCopyMode = False
End Sub
The code works perfectly fine, just that I have a lot of data to pull (the above are just 2 of the data to be pulled, therefore when I run the code, it will keep activating Database file every time when it pulls from a new column, which makes my laptop to slow down, and even worse, Excel will crash. So I am wondering if there is any way to stop activating the Database file for each time?
I have tried doing the code shown below, but it gives me an error saying Select Method of range class failed (highlighting the first line):
VBA Code:
Workbooks("Database.xlsm").Worksheets("Overall").Range("E5").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy _
Workbooks("Framework.xlsm").Worksheets("NEW").Range("A5")
Application.CutCopyMode = False
Hope to receive help as soon as possible