def write_codelist_to_xls(worksheet, rows, header, row_nbr=0):
    """
    write code list, value level, or where clause rows to the odmlib worksheet
    :param worksheet: odmlib worksheet object to write to
    :param rows: a list of dictionaries (rows) to write to the worksheet
    :param row_nbr: integer row number that indicates which worksheet row to begin appending terms
    :return: integer row number that indicates the next row to begin appending content
    """
    for row in rows:
        row_nbr += 1
        for c, col_name in enumerate(header):
            worksheet.write(row_nbr, c, row[col_name])
    return row_nbr