+ Reply to Thread
Results 1 to 6 of 6

Creating a ListBox from a Row of Cells

  1. #1
    Registered User
    Join Date
    06-18-2015
    Location
    Newport, Wales
    MS-Off Ver
    MS 2003
    Posts
    2

    Creating a ListBox from a Row of Cells

    Ive tried to add the contents of a Row of cells "B3:F3" from a sheet 'TOTALS' to a drop down box using the below code, the sheets cells contain dates formatted as Dates.

    The output should look like this :

    01-09-15
    02-09-15
    03-09-15
    04-09-15
    05-09-15

    Please Login or Register  to view this content.
    When i use the code the output is:

    30-12-99
    30-12-99
    30-12-99
    30-12-99
    30-12-99

    Ive also tried to use 'CDate' instead of 'Val' but i get a run time error. Any ideas on where i might be going wrong?

  2. #2
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Creating a ListBox from a Row of Cells

    Sir You can use list row source property to show the value in list box
    1. just name the range of your date
    2. select list box and in property goto rowsource and than write name of the range items will display in list

  3. #3
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Creating a ListBox from a Row of Cells

    sample file attached
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-18-2015
    Location
    Newport, Wales
    MS-Off Ver
    MS 2003
    Posts
    2

    Re: Creating a ListBox from a Row of Cells

    Thanks Kamboj

    Unfortunately this only seems to work when the range is a Column, it doesnt work when the range is a Row. When the same principle is applied to a Row of Cells only the first Cell appears in the list, the following cells do not appear underneath as showen in the above output that i require.

  5. #5
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Creating a ListBox from a Row of Cells

    FOR ROWS VALUES YOU CAN USE THIS CODE
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Creating a ListBox from a Row of Cells

    if your data in range the use this
    Please Login or Register  to view this content.

+ 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. Creating a Range of a Listbox based on the Selection Made in Another ListBox
    By masood78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-02-2014, 11:03 AM
  2. creating listbox
    By laric in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2012, 11:21 AM
  3. Problems in creating a listbox()
    By jray9242 in forum Excel General
    Replies: 2
    Last Post: 10-14-2011, 02:19 PM
  4. VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox)
    By modjoe23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-18-2005, 09:35 AM
  5. [SOLVED] Creating a listbox from a column
    By Stephan Bielicke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-20-2005, 06: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