title: How to copy and paste existing sheet in existing workbook using python?
body: <p>I've been searching for a way to do the following:</p>
  
  <ol>
  <li><p>Open an existing workbook that contains several worksheets, <code>.xlsl</code>.</p></li>
  <li><p>Create a new worksheet, and rename it.</p></li>
  <li><p>Copy data and formatting from an existing worksheet, named 'Template', and paste that data to the previously created worksheet. </p></li>
  </ol>
  
  <p>Is there any way to do what I need? </p>
  
  <p><strong>EDIT:</strong>
  This is the way how to do it:</p>
  
  <pre><code>import openpyxl
  from openpyxl.worksheet.copier import WorksheetCopy
  
  workbook = openpyxl.load_workbook('input.xlsx')
  template_worksheet = workbook.get_sheet_by_name(sheet_name)
  new_worksheet = workbook.create_sheet('New_Sheet_Name')
  instance = WorksheetCopy(template_worksheet, new_worksheet)
  WorksheetCopy.copy_worksheet(instance)
  workbook.save('output.xlsx')
  </code></pre>