I want to get value of a merged cell that has range from D3 to H3 using openpyxl library. As per my understanding most libraries read data from 1st cell itself. Thus the mer
from openpyxl import *
from openpyxl.utils import *
def getValueWithMergeLookup(sheet, cell):
if cell == None or sheet == None:
return None
for irange in sheet.merged_cell_ranges:
min_col, min_row, max_col, max_row =range_boundaries(irange)
if cell.row in range(min_row,max_row+1) and column_index_from_string(cell.column) in range(min_col,max_col+1):
return sheet.cell(None,min_row,min_col).value
return cell.value