Here is the solution. Though you will need to make some changes to the code below.
a] Get_Copy_Data - This is what you want to name your macro. Leaving it as is will not affect the code.
b] CopyDataSheet - This is the name of the sheet you would like the data copied to.
c] C:\Users\z3n\Desktop\hapy.xlsx - This is the file path of the excel workbook that already has the data. Make sure it is in the first tab.
d] hapy.xlsx - This is the excel workbook that has the data already
b] CopyDataSheet - This is the name of the sheet you would like the data copied to.
c] C:\Users\z3n\Desktop\hapy.xlsx - This is the file path of the excel workbook that already has the data. Make sure it is in the first tab.
d] hapy.xlsx - This is the excel workbook that has the data already
1) Hit Alt + F11 (this will open the VBE Window)
2) Select 'Module' from the 'Insert Menu' and paste the code below.
Sub Get_Copy_Data()
Sheets("CopyDataSheet").Select
Range("D7").Activate
Selection.ClearContents
ThisWorkbook.Activate 'start in THIS workbook
Sheets(1).Select 'switch to data import sheet
'Opens source file (this filename never changes)
Workbooks.Open Filename:="C:\Users\z3n\Desktop\hapy.xlsx", ReadOnly:=True
Workbooks("hapy.xlsx").Activate 'switch to source workbook
Sheets(1).Select 'switch to source data sheet
[a1].CurrentRegion.Copy 'Copy data to clipboard
ThisWorkbook.Activate 'Return to THIS workbook
[G7].PasteSpecial Paste:=xlPasteValues 'paste data to import start cell
[a1].Select 'cancels highlighted paste region
Workbooks("hapy.xlsx").Close 'close source data workbook
Sheets("CopyDataSheet").Select
Range("A1").Select
ActiveSheet.Paste
End Sub
At the moment, you'll have to save this in your "Personal" macro book. It has trouble when you save the macro in the workbook itself.