'Merge a range of cells.
Args:
first_row:    The first row of the cell range. (zero indexed).
first_col:    The first column of the cell range.
last_row:     The last row of the cell range. (zero indexed).
last_col:     The last column of the cell range.
data:         Cell data.
cell_format:  Cell Format object.
Returns:
0:    Success.
-1:    Row or column is out of worksheet bounds.
other: Return value of write().'

@convert_range_args
def merge_range(self, first_row, first_col, last_row, last_col, data, cell_format=None):

    if ((first_row == last_row) and (first_col == last_col)):
        warn("Can't    merge    single    cell")
        return
    if (first_row > last_row):
        (first_row, last_row) = (last_row, first_row)
    if (first_col > last_col):
        (first_col, last_col) = (last_col, first_col)
    if (self._check_dimensions(last_row, last_col) == (-1)):
        return
    self.merge.append([first_row, first_col, last_row, last_col])
    self.write(first_row, first_col, data, cell_format)
    for row in range(first_row, (last_row + 1)):
        for col in range(first_col, (last_col + 1)):
            if ((row == first_row) and (col == first_col)):
                continue
            self.write_blank(row, col, '', cell_format)
