+ Reply to Thread
Results 1 to 4 of 4

List Box question

  1. #1
    Registered User
    Join Date
    05-11-2007
    Posts
    93

    Question List Box question

    Hi all,
    I created an excel sheet which has many drop down list boxes. I have written the data for these list boxes in my excel sheet itself .

    But i dont think having list box values in the excel sheet itself is not right .

    Is there any way where i can enter an array of these values in VBA and populate the list box from these arrays?

    Thanks you.
    Glen.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Are you using a single column listbox/ If so this will populate ListBox one each time the sheet is accessed. Place it in the Worksheet object

    Quick Instructions On How to Add Code to a Sheet Object
    Open the VBE (Alt+F11) and then double click the Sheet in the Project Explorer the code applies to. This is where the code MUST be placed.


    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    05-11-2007
    Posts
    93

    Question

    Roy, i didnt understand what is 'ListBox1' .
    I dont see any option to name a Listbox.

    To define a listbox i go to Data->validation . and in settings i set the Type as List and define the range in excel sheet where i should get the values to populate the list box.

    So if i dont want to have my list box data in the excel sheet and populate the data from VBA arrays how can i do it?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    That's not a listBox, it's Data Validation!

    In the Data validation Wizard instead of typing a Range you can type your list separated by commas - see the Data Validation Tutorial here

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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