title: Openpyxl copy and paste as values in new workbook
body: <p>I am trying to copy the first 100 rows in a source file to a new destination file with openpyxl. My source file has formulas, but I want to copy and paste as values in the new workbook. When I add data_only=True, (see code below), it copies only the values of my source sheet and therefore not the data in the formula cells - these are just empty in the destination file. How do I copy everything and paste as values in the destination sheet?</p>
  <pre><code>WB1 = load_workbook(&quot;sample_book.xlsx&quot;)
  WB1_WS1 = WB1[&quot;Ark2&quot;]
  WB2 = Workbook()
  
  #Create new worksheet in new workbook
  for i in range(1,2):
      WB2.create_sheet(f&quot;WS{i}&quot;)
      
  #Delete first sheet
  WB2.remove(WB2.worksheets[0])
  
  #Define the ranges and sheets 
  copy_ranges = [100]
  copy_to_sheets = [&quot;WS1&quot;]
  
  # Copy the values from the rows in WB1 to WB2
  for i in range (len(copy_ranges, data_only=True)):
      #Set the sheet to compy to
      ws = WB2[copy_to_sheets[i]]
      #initialize row offset 
      offset = 1
      for s in range (i):
          offset+=copy_ranges[s]
          
      #copy the row and append 
      for j in range(offset, offset + copy_ranges[i]):
          #if j==0:
          #  continue 
          for row in WB1_WS1.iter_rows(min_row=j,max_row=j,min_col=1,max_col=WB1_WS1.max_column):
              values_row = [cell.value for cell in row]
          ws.append(values_row)
  
  #save
  WB2.save(&quot;WB2.xlsx&quot;)
  </code></pre>