REFHELPER_REGEXP_CELLREF
REFHELPER_REGEXP_CELLREF = '((\\w*|\'[^!]*\')!)?(?<![:a-z\\$])(\\$?[a-z]{1,3}\\$?\\d+)(?=[^:!\\d\'])'
Regular Expressions
$instance : \PhpOffice\PhpSpreadsheet\ReferenceHelper
Instance of this class.
insertNewBefore(string $pBefore, int $pNumCols, int $pNumRows, \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet) : void
Insert a new column or row, updating all possible related data.
string | $pBefore | Insert before this cell address (e.g. 'A1') |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
updateFormulaReferences(string $pFormula = '', string $pBefore = 'A1', int $pNumCols, int $pNumRows, string $sheetName = '') : string
Update references within formulas.
string | $pFormula | Formula to update |
string | $pBefore | Insert before this one |
int | $pNumCols | Number of columns to insert |
int | $pNumRows | Number of rows to insert |
string | $sheetName | Worksheet name/title |
Updated formula
updateCellReference(string $pCellRange = 'A1', string $pBefore = 'A1', int $pNumCols, int $pNumRows) : string
Update cell reference.
string | $pCellRange | Cell range |
string | $pBefore | Insert before this one |
int | $pNumCols | Number of columns to increment |
int | $pNumRows | Number of rows to increment |
Updated cell range
updateNamedFormulas(\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet, string $oldName = '', string $newName = '') : void
Update named formulas (i.e. containing worksheet references / named ranges).
\PhpOffice\PhpSpreadsheet\Spreadsheet | $spreadsheet | Object to update |
string | $oldName | Old name (name to replace) |
string | $newName | New name |
adjustPageBreaks(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update page breaks when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
adjustComments(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update cell comments when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
adjustHyperlinks(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update hyperlinks when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
adjustDataValidations(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update data validations when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
adjustMergeCells(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update merged cells when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
adjustProtectedCells(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update protected cells when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
adjustColumnDimensions(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update column dimensions when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
adjustRowDimensions(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, string $pBefore, int $beforeColumnIndex, int $pNumCols, int $beforeRow, int $pNumRows) : void
Update row dimensions when inserting/deleting rows/columns.
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet | $pSheet | The worksheet that we're editing |
string | $pBefore | Insert/Delete before this cell address (e.g. 'A1') |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
cellAddressInDeleteRange(string $cellAddress, int $beforeRow, int $pNumRows, int $beforeColumnIndex, int $pNumCols) : bool
Test whether a cell address falls within a defined range of cells.
string | $cellAddress | Address of the cell we're testing |
int | $beforeRow | Number of the row we're inserting/deleting before |
int | $pNumRows | Number of rows to insert/delete (negative values indicate deletion) |
int | $beforeColumnIndex | Index number of the column we're inserting/deleting before |
int | $pNumCols | Number of columns to insert/delete (negative values indicate deletion) |
updateCellRange(string $pCellRange = 'A1:A1', string $pBefore = 'A1', int $pNumCols, int $pNumRows) : string
Update cell range.
string | $pCellRange | Cell range (e.g. 'B2:D4', 'B:C' or '2:3') |
string | $pBefore | Insert before this one |
int | $pNumCols | Number of columns to increment |
int | $pNumRows | Number of rows to increment |
Updated cell range
updateSingleCellReference(string $pCellReference = 'A1', string $pBefore = 'A1', int $pNumCols, int $pNumRows) : string
Update single cell reference.
string | $pCellReference | Single cell reference |
string | $pBefore | Insert before this one |
int | $pNumCols | Number of columns to increment |
int | $pNumRows | Number of rows to increment |
Updated cell reference