Skip to content

Commit 391e630

Browse files
authored
Add removeCommentByColumnAndRow function
1 parent 5608e05 commit 391e630

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/PhpSpreadsheet/Worksheet/Worksheet.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,6 +2581,22 @@ public function setComments(array $comments)
25812581

25822582
return $this;
25832583
}
2584+
2585+
2586+
/**
2587+
* Remove comment.
2588+
*
2589+
* @param int $columnIndex Numeric column coordinate of the cell
2590+
* @param int $row Numeric row coordinate of the cell
2591+
*
2592+
*/
2593+
public function removeCommentByColumnAndRow($columnIndex, $row)
2594+
{
2595+
$pCellCoordinate = strtoupper(Coordinate::stringFromColumnIndex($columnIndex) . $row);
2596+
if(isset($this->comments[$pCellCoordinate])) {
2597+
unset($this->comments[$pCellCoordinate]);
2598+
}
2599+
}
25842600

25852601
/**
25862602
* Get comment for cell.

0 commit comments

Comments
 (0)