Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8433557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:25:08+00:00 2026-06-10T06:25:08+00:00

I have an unidimensional array that can have more the 50 elements and I’d

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:25:10+00:00Added an answer on June 10, 2026 at 6:25 am

    I just solved it. I found out the problem:

        $blocksList = implode (", ", $blockNames);
        $objPHPExcel = new PHPExcel();
        $objPHPExcel->getProperties()->setCreator("lalala SAS")
                    ->setTitle("Bulk Upload Template");
        //Data Validation list
        $objValidation = $objPHPExcel->getActiveSheet()->getCell('B3')->getDataValidation();
        $objValidation->setType(PHPExcel_Cell_DataValidation::TYPE_LIST);
        $objValidation->setErrorStyle(PHPExcel_Cell_DataValidation::STYLE_INFORMATION);
        $objValidation->setAllowBlank(true);
        $objValidation->setShowDropDown(true);
        $objValidation->setErrorTitle('Input error');
        $objValidation->setError('Value is not in list');
        $objValidation->setFormula1('"'.$blocksList.'"');
    

    The problem is that my $blocksKist is too big and excel formula support only 255 characters. This way, I’ll add my $blocksList into another sheet and read it from that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have span that may or may not have text content. is there a way
Have a recurring situation, petty I know, but I'd like to consolidate the following:
Have an app that can use tts to read text messages. It can also
I have a collection uni-dimensional like this: [1,2,4,5.....n] I would like to convert that
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
Have a bunch of WCF REST services hosted on Azure that access a SQL
Have a look at one of my websites: moskah.com The problem is that it
Have a simple contact us XPage created. Have server side validation in place that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.