I have an unidimensional array that can have more the 50 elements and I’d like to know a way to add it into an excel cell.
I’m using PHPExcel, and I know I must use PHPExcel_Cell_DataValidation::TYPE_LIST to do it, but I didn’t find a way to pass the elements of my array to an excel cell.
In fact, what I want is to count how many elements I have in this array and set the same dropdown (data validation list) as many times as the amount of elements, in the cells of the A column.
Can someone give me any idea?
EDIT – Explaining a little more the problem: I have a list of block names, and i’m trying to create a template file that the user can download to update data of new blocks. If he add a different block name, it will create a new block, instead of updating, this is why I want to use a data validation list in each cell of the ‘A’ column inside a sheet. This way the user can select block names that already exists (he won’t make confusion writing its names). Also, he doesn’t need to have all the blocks in the cells, because he can update data of 2 blocks in a list with more than 50 blocks. (if he has all the blocks filling the cells, when he upload the template, he will also upload the data of the blocks that he left empty… I think now it’s easier to understand my problem.
I just solved it. I found out the problem:
The problem is that my $blocksKist is too big and excel formula support only 255 characters. This way, I’ll add my
$blocksListinto another sheet and read it from that.