def repeat_rows(row_min, row_max = nil)
      row_max ||= row_min

      # Convert to 1 based.
      row_min += 1
      row_max += 1

      area = "$#{row_min}:$#{row_max}"

      # Build up the print titles "Sheet1!$1:$2"
      sheetname = quote_sheetname(@name)
      @page_setup.repeat_rows = "#{sheetname}!#{area}"
    end
def repeat_rows(row_min, row_max = nil)
      row_max ||= row_min

      # Convert to 1 based.
      row_min += 1
      row_max += 1

      area = "$#{row_min}:$#{row_max}"

      # Build up the print titles "Sheet1!$1:$2"
      sheetname = quote_sheetname(@name)
      @page_setup.repeat_rows = "#{sheetname}!#{area}"
    end
Set the number of rows to repeat at the top of each printed page.

 For large Excel documents it is often desirable to have the first row
 or rows of the worksheet print out at the top of each page. This can
 be achieved by using the repeat_rows() method. The parameters
 first_row and last_row are zero based. The last_row parameter is
 optional if you only wish to specify one row:

     worksheet1.repeat_rows(0)    # Repeat the first row
     worksheet2.repeat_rows(0, 1) # Repeat the first two rows