Oh, I see, you can check the cell’s IsMerged
property and retrieve the range of merged cells using the getRangeAddresses()
method from the Table
object.
Sudo code:
# Initialize ColSpan
col_span = 1
# Check if the cell is part of a merged cell
if cell.IsMerged:
# If merged, find the range address of the merged cell
merged_range = cell.getRangeAddresses()[0]
col_span = merged_range.EndColumn - merged_range.StartColumn + 1