close
Change a cell into a clickable URL
You can make a cell a clickable URL by setting its hyperlink property:
$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl('https://www.example.com');
If you want to make a hyperlink to another worksheet/cell, use the following code:
$spreadsheet->getActiveSheet()->setCellValue('E26', 'www.phpexcel.net');
$spreadsheet->getActiveSheet()->getCell('E26')->getHyperlink()->setUrl("sheet://'Sheetname'!A1");
--
https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/
全站熱搜
留言列表