0

I want to have more than one hyperlink in same excel cell using phpspreadsheet

Column1    Column2
___________________

Cell1      Link1
___________________
Cell2      Link1
           Link2
           Link3
___________________

I tried write it as following

$sheet->setCellValueByColumnAndRow(28, $i,"=HYPERLINK('http://www.google.co.uk','GOOGLE')&CHAR(10)&HYPERLINK('http://www.amazon.co.uk','AMAZON')");

but the generated excel file isn't readable by excel, I know how to put only one hyperlink using

$sheet->setCellValue('1'.'1', 'Showfile');
$sheet->getCell('A'.1)->getHyperlink()->setUrl('http://localhost/upload/'.$strFile);

1 Answers1

0

It's not possible to have more than one hyperlink in a cell in Excel. See https://answers.microsoft.com/en-us/msoffice/forum/all/multiple-hyperlinks-in-a-cell/0dbf112c-3e21-4d2d-98ca-bf6e8e10a6eb

Also see How to add multiple links in excel cell?

Jacob Mulquin
  • 3,458
  • 1
  • 19
  • 22