title: How do I write a macro to open an excel file and paste data into the file containing the macro?
body: <p>I have two excel files. One of which contains a macro. The other is a shared workbook. I have some code already written. It opens up the shared woorkbook file and it has selected all of the data on a specified tab. </p>
  
  <p>The only problem is I'm unsure on how to write code that will automatically paste this data into the file with the macro?</p>
  
  <pre><code>Sub ImportData_Click()
  
  ' open the source workbook and select the source sheet
  Workbooks.Open Filename:="Test.xlsm"
  Sheets("Make").Select
  
  ' copy the source range
  Sheets("Make").Range("A1:Z630").Select
  Selection.Copy
  
  ' select current workbook and paste the values starting at U4
  Sheets("Make").Select
  Sheets("Make").Range("A1:Z630").Select
  Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
  False, Transpose:=False
  
  ' close the source workbook
  Windows("Test.xlsm").Activate
  ActiveWorkbook.Close
  
  End Sub
  </code></pre>