title: Copy columns from workbook, paste in second sheet of second workbook, openPyXL
body: <p>I'm new to openpyxl and am developing a tool that requires copying &amp; pasting columns. </p>
  
  <p>I have a folder containing two sets of excel files. I need the script to iterate through the files, find the ones that are named "GenLU_xx" (xx represents name of a place such as Calgary) and copy Columns C &amp; E (3 &amp; 5). It then needs to find the corresponding file which is named as "LU_Summary_xx" (xx again represents name of place such as Calgary) and paste the copied columns to the second sheet of that workbook. It needs to match GenLU_Calgary with LUZ_Summary_Calgary and so forth for all the files. So far I have not been able to figure out code for copying and pasting columns and the seemingly double iteration is confusing me. My python skills are beginner although I'm usually able to figure out code by looking at examples. In this case I'm having some trouble locating sample code. Just started using openpyxl. I have completed the script except for the parts pertaining to excel. Hopefully someone can help out. Any help would be much appreciated! </p>
  
  <p>EDIT: New to StackOverflow as well so not sure why I got -2. Maybe due to lack of any code?</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>    import os, openpyxl, glob
  from openpyxl import Workbook
  Tables = r"path"
  os.chdir(Tables)
  for file in glob.glob ("LUZ*"):
      wb = openpyxl.load_workbook(file)
      ws = wb.active
      ws ["G1"] = "GEN_LU_ZN"
      wb.create_sheet(title="Sheet2")
      wb.save(file)
  </code></pre>
  
  <p>This just adds a value to G1 of every file starting with LUZ and creates a second sheet. </p>
  
  <p>As I mentioned previously, I have yet to even figure out the code for copying the values of an entire column. </p>
  
  <p>I am thinking I could iterate through all files starting with "GenLU*" using glob and then store the values of Columns 3 &amp; 5 but I'm still having trouble figuring out how to access values for columns. I do not have a range of rows as each workbook will have a different number of rows for the two columns. </p>
  
  <p>EDIT 2: I am able to access cell values for a particular column using this code:</p>
  
  <pre><code>for file in glob.glob ("GenLU_Airdrie*"):
      wb = openpyxl.load_workbook(file, use_iterators=True)
      ws = wb.active
      for row in ws.iter_rows ('C1:C200'):
          for cell in row:
              values = cell.value
              print values
  </code></pre>
  
  <p>However I'm not sure how I would go about 'pasting' these values in column A of the other sheet.</p>