def write_mergecells(worksheet):
 cells = worksheet._merged_cells
 if (not cells):
  return
 merge = Element('mergeCells', count=('%d' % len(cells)))
 for range_string in cells:
  merge.append(Element('mergeCell', ref=range_string))
 return merge

def write_mergecells ( worksheet ) : cells = worksheet . _merged_cells if ( not cells ) : return merge = Element ( 'mergeCells' , count = ( '%d' % len ( cells ) ) ) for range_string in cells : merge . append ( Element ( 'mergeCell' , ref = range_string ) ) return merge
write merged cells to xml .