The setCellValue() function is an inbuilt function in PHPSpreasheet which is used to set the value of a cell in a spreadsheet.
setCellValue( $coordinate, $value )
Parameters: This function accepts two parameters as mentioned above and described below:
- $coordinate: This parameter is used to store the value of the coordinate of the excel sheet.
- $value: This parameter is used to store the value of data which is to be set in excel sheet.
Return Value: This function returns Object of class PhpOffice\PhpSpreadsheet\Worksheet\Worksheet.
Alternatively, It can be achieved by retrieving the cell object firstly and then set the value. For this purpose, Cell object can be retrieved with the help of getCell() function and then the value can be set with the help of setValue() function.
- PHP | Spreadsheet | Setting a date and/or time value in a cell
- PHP | Spreadsheet
- How to Convert HTML Table into Excel Spreadsheet using jQuery ?
- How to prevent text in a table cell from wrapping using CSS?
- How to create equal width table cell using CSS ?
- How to wrap table cell <td> content using CSS ?
- How place a checkbox into the center of a table cell?
- How to create table cell using HTML5 ?
- How to create a header cell in a table using HTML5 ?
- How to define the number of columns a cell should span using HTML5 ?
- How to push a value based on matched value in PHP ?
- How to get hex color value of RGB value ?
- How to change an element color based on value of the color picker value using onclick?
- ReactJS | Setting up Development Environment
- Creating Knockout Application along with Setting up Environment in Visual Studio
- Git- Setting up a Repository
- JQuery | Setting background-image using CSS property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.