title: copy cell style openpyxl
body: <p>I am trying to copy a sheet, <code>default_sheet</code>, into a new sheet <code>new_sheet</code> in the same workbook.</p>
  
  <p>I did managed to create a new sheet and to copy the values from default sheet. How can I also copy the style of each cell into the new_sheet cells?</p>
  
  <pre class="lang-python prettyprint-override"><code>new_sheet = workbook.create_sheet()
  new_sheet.title = sheetName
  default_sheet = workbook.get_sheet_by_name('default')
  new_sheet = workbook.get_sheet_by_name(sheetName)
  for row in default_sheet.rows:
      col_idx = float(default_sheet.get_highest_column())
  starting_col = chr(65 + int(col_idx))
  for row in default_sheet.rows:
      for cell in row:
          new_sheet[cell.get_coordinate()] = cell.value
          &lt;copy also style of each cell&gt;
  </code></pre>
  
  <p>I am at the moment using openpyxl 1.8.2, but i have in mind to switch to 1.8.5.</p>
  
  <p>One solution is with copy:</p>
  
  <pre class="lang-python prettyprint-override"><code>from copy import copy, deepcopy
  
  new_sheet._styles[cell.get_coordinate()] = copy(
          default_sheet._styles[cell.get_coordinate()])
  </code></pre>