title: How to automatically copy columns from one excel file to another excel file in different sheets
body: <p>I am really new to visual basic (not even a day old :)) and your help will be greatly appreciated.</p>
  
  <p>I have two excel files, the Source and the Target file. The source file is full of information all in the first tab/sheet in different columns. The Target file is half empty (the rest is pre-populated with default values) and needs to be filled with the same values as the Source file (destination format would be good if we can keep) but in different columns across different tabs.</p>
  
  <p>Could someone please enlighten me with a macro function that can:</p>
  
  <p>(For example:)</p>
  
  <p>1) Take the contents from the Source file/Sheet 1/Column A3 and below and copy it in the Target File/Sheet 1/Column X7 and below</p>
  
  <p>2) Take the contents from the Source file/Sheet 1/Column B3 and below and copy it in the Target File/Sheet 2/Column X5 and below</p>
  
  <p>3) Take the contents from the Source file/Sheet 1/Column C3 and below and copy it in the Target File/Sheet 1/Column Y2 and below and at the same time in the Target File/Sheet 2/Column Z4 and below.</p>
  
  <p>So basically column A goes to the first tab column X of another file, B goes to the second tab column X and C goes to both the first and second tabs, columns Y and Z respectively. (With the possibility the starting row in the Target file, to be different each time.)</p>
  
  <hr>
  
  <p>If I have the basic structure code, I think I will be able to adapt it with the file locations, workbook/sheet names and columns for my specific problem. </p>
  
  <p>Thank you a lot for your time to answer my question and looking forward to any ideas you might have! Please let me know of course if you need further clarification on something.</p>
  
  <p>Cheers!<br>
  Panos</p>
  
  <p>P.S.1. Please note that we want to copy from one file to another (not across different sheets in the same file!)<br>
  P.S.2. Is just about copying columns from one excel file to another, I don't mind to have the opening/closing/saving workbook automations or any other automations. </p>
  
  <p>Maybe a starting function could be?</p>
  
  <pre><code>Sub Demo() 
  
  Dim wbSource As Workbook 
  Dim wbTarget As Workbook 
  
  ‘ First open both workbooks : 
  Set wbSource = Workbooks.Open(“”) ‘ &lt;&lt;&lt; path to source workbook 
  Set wbTarget = Workbooks.Open("") ' Workbooks.Open(" ") ' &lt;&lt;&lt; path to destination workbook 
  
  'Now, transfer values from wbSource to wbTarget: 
  
  wbTarget.Sheets("Sheet Name?").Range("A3:A9999").Value = wbSource.Sheets("Sheet Name?").Range("X7:X9999") wbSource.Close 
  
  End Sub
  </code></pre>