code: public function lastColumn()
      {
          $xlSheet = $this->xlSheet();
          $highestColumn = $xlSheet->getHighestColumn(); // e.g 'F'
          $highestColumnIndex = Cell\Coordinate::columnIndexFromString($highestColumn); // e.g. 5
  
          return $highestColumnIndex;
      }
docs: {@inheritDoc}
  @link https://phpspreadsheet.readthedocs.io/en/develop/topics/accessing-cells/#looping-through-cells-using-indexes