+ Reply to Thread
Results 1 to 6 of 6

Show first item in dropdown list instead of blank with VBA

  1. #1
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Show first item in dropdown list instead of blank with VBA

    Hi, I have a list which contains formulas which I think is causing the problems. I tried to make a dynamic list and a table as explained on the Contextures website but either the list will not grow when a word is added (because of the formula?), or it is as long as the list of formulas, which is then showing the blanks and you have to scroll up to find the words in the list. I have also tried this from Extendoffice, but it does not work either. Attached is a simple example. The list is in column A, made into a table and contains formula. The dropdown list is in cell C1 which shows the whole list and not just 1. I also added a new formula in A12 which didn't expand the table either. Can someone help? Thanks!
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by thecdnmole; 12-12-2018 at 02:28 PM.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,012

    Re: Show first item in dropdown list instead of blank with VBA

    .
    https://excelchamps.com/blog/dynamic-drop-down-list/

  3. #3
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Show first item in dropdown list instead of blank with VBA

    Thanks for the reply Logit, but the link is more or less the same was what I tried from the Conextures website which didn't work because of the formulas in the list, but I only want the list to show the results of the formula.

  4. #4
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Show first item in dropdown list instead of blank with VBA

    Ok, I just tried the sub from Extendoffice on my example workbook I uploaded and it worked! But, if I move the list to another worksheet it does not work. Can someone help with that? I have all my lists on a seperate hidden worksheet. Thanks!

  5. #5
    Forum Contributor
    Join Date
    08-22-2009
    Location
    Manitoba
    MS-Off Ver
    Office 2010
    Posts
    524

    Re: Show first item in dropdown list instead of blank with VBA

    I figured it out! If the list isn't on the same worksheet, then in this line, Target.Cells(1) = Range(Mid(xFormula, 1)).Cells(1).Value, you need to add the sheet name, as in Target.Cells(1) = Sheet1.Range(Mid(xFormula, 1)).Cells(1).Value.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,012

    Re: Show first item in dropdown list instead of blank with VBA

    .
    Gald you have it solved !

+ 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] Resetting all dropdown menus to first item in list
    By KJL in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 05-10-2020, 12:15 PM
  2. Remove items from dropdown list when item value = 0
    By technolog in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2017, 09:57 AM
  3. Combobox Dropdown List only shows first Item
    By Guido Meng in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-20-2013, 09:49 PM
  4. use dropdown and show another item automatically
    By mtsf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-14-2013, 03:06 AM
  5. Replies: 8
    Last Post: 01-23-2012, 10:28 AM
  6. Any way to get the index of a selected item from a dropdown list?
    By chitian5057 in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 05-13-2010, 02:41 PM
  7. [SOLVED] How can I set up to chose more than 1 item from a dropdown list (.
    By microchick in forum Excel General
    Replies: 4
    Last Post: 04-07-2005, 02:06 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