+ Reply to Thread
Results 1 to 18 of 18

Display list depending whether cell is blank or not

  1. #1
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Display list depending whether cell is blank or not

    Hi, I need my worksheet to display a list which, in case any of the columns on the right are not blank, display a list of the headers which containt the non blank cells.

    Here is an example;

    Header List Asia Africa N.America S.America Europe Oceania Antartica
    Sales list1 210 12 41 2

    I'd need it to dropdown list1 with the list of headers where there have been sales (Asia, N.America, S.America and Oceania)(Please have into account that my worksheet has 10 thousand rows).

    Also, the workbook has 30 sheets with column "K" value being the sale value for that sheet country. Lets say one of the worksheets is called "Italy", I'd like the excel, in case cell "K7" of Italy worksheet is not empty, to add it to a list in a list on cell "B7" on general. Do this for as many worksheets there are, the same for other sales, check cells "K8" and add it to "B8" in general...Hope I was able to explain myself

    Any help is welcome, thanks!!
    Last edited by gonurvia; 05-03-2017 at 04:21 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Only if length of characters of the list is less than 255 then.
    Assuming the header in row1, data starts from row2.

    To a worksheet code module
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    Hi jindon, thanks for the answer!!. It does work, however the header is in row 6, data row 7 and goes from column "E" to "BA". I've tried changing the code but doesn´t seem to work. Could you check any mistakes please??

    Please Login or Register  to view this content.
    Also, some headers are combined cells (row 5 & 6) but not sure if that might be part of the error or not.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Quote Originally Posted by gonurvia View Post
    Hi jindon, thanks for the answer!!. It does work, however the header is in row 6, data row 7 and goes from column "E" to "BA". I've tried changing the code but doesn´t seem to work. Could you check any mistakes please??
    As I have said 255 characters, so it is not possible without hidden sheet.
    Try change to
    Please Login or Register  to view this content.
    Quote Originally Posted by gonurvia View Post
    Also, some headers are combined cells (row 5 & 6) but not sure if that might be part of the error or not.
    What do you mean?

  5. #5
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    Captura.PNG

    This is what it looks like. I've replaced the code into "Analisis" sheet code but doesn't seem to work, am I doing it right?. Im kind of new to VBA and not very good at programming either so sorry for asking so dumb questions

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Remove merged cell and make row 6 a header.

    And change to code to
    Please Login or Register  to view this content.
    Edit: Code
    Last edited by jindon; 05-03-2017 at 06:29 AM. Reason: Code has been edited

  7. #7
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    Thank you very much for your time jindon, I did as you said but no changes appear...

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Then you need to upload your workbook.

  9. #9
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    Sadly I can't, as the workbook has sensible information.
    Maybe its easier if I make a function out of 2 vectors
    Something like this;

    Please Login or Register  to view this content.
    So, anytime there is a number over 0, it adds the cell text to the list, for all the cells in my range.
    P2 would be a vector with the country names
    P2 (D6:BA6)
    P1 (D7:BA7)

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Quote Originally Posted by gonurvia View Post
    Sadly I can't, as the workbook has sensible information.
    What are you talking about?

    I don't need data, just heading.
    P.S
    Just change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by jindon; 05-03-2017 at 08:00 AM.

  11. #11
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    I don't know why it doesn't work for me yet. The one you attached did work, but as soon as I changed the start columns it didn't work.
    Attached Files Attached Files

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Where (which column) do you want the validation list?

  13. #13
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    Column D please

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    It still seems not to work

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,591

    Re: Display list depending whether cell is blank or not

    Working...............
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    Yep, it does work but for some strange reason when I paste it on my workbook it crashes... Anyways, you haven't stopped helping me so thank you very very much!!

  18. #18
    Registered User
    Join Date
    03-29-2017
    Location
    Madrid
    MS-Off Ver
    2013
    Posts
    38

    Re: Display list depending whether cell is blank or not

    Hi jindon, finally I've found the reason of why wasn't it working for me. I've attached a file where you may see it. Apparently, Excel only saves the last 500 values of the whole list hence, if I have 1000 rows, it will "show" a list with the first 500 values as blank and show the next 500 values correctly. You may look at it here:
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Cell to display list depending on value in other cell
    By shaunguyver in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 04-15-2015, 07:30 AM
  2. Display text depending on one or more cell with value
    By redline24 in forum Excel General
    Replies: 6
    Last Post: 10-09-2014, 06:57 PM
  3. How to Display a comment box depending on the cell value
    By sameister in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-20-2013, 09:22 AM
  4. VBA Code - Display an Array List Depending on Date Range
    By sandonn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2013, 11:31 AM
  5. Display last text value depending on another cell
    By willia97 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2012, 01:19 AM
  6. cell display depending on date
    By djmiller in forum Excel General
    Replies: 2
    Last Post: 10-09-2008, 09:39 AM
  7. [SOLVED] display text depending on coice from drop down list
    By Calle in forum Excel General
    Replies: 11
    Last Post: 05-28-2006, 04:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1