Replies: 1 comment
-
$spreadsheet = new Spreadsheet();
$sheet1 = $spreadsheet->getActiveSheet();
$sheet1->setTitle('Sheet1');
$sheet2 = $spreadsheet->createSheet();
$sheet2->setTitle('Sheet2');
$sheet2->getCell('A1')->setValue('row1');
$sheet2->getCell('A2')->setValue('row2');
$sheet2->getCell('A3')->setValue('row3');
$sheet2->getCell('A4')->setValue('row4');
$validation = $sheet1->getCell('A1')
->getDataValidation();
$validation->setType(DataValidation::TYPE_LIST);
$validation->setErrorStyle(DataValidation::STYLE_STOP);
$validation->setAllowBlank(false);
$validation->setShowInputMessage(false);
$validation->setShowErrorMessage(true);
$validation->setShowDropDown(true);
$validation->setFormula1('=Sheet2!$A:$A'); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Uma dúvida, imaginem uma planilha com duas abas, na primeira aba tenho uma coluna chamada de unidades de medidas, nela o usuário teria que escolher clicando na celular aí, listar todas as unidade de medida, que estão listadas na segunda aba. Será que é possível fazer isso?
Beta Was this translation helpful? Give feedback.
All reactions