Consulting

Results 1 to 6 of 6

Thread: Automatic alphabetic scrolling in a listbox

  1. #1
    VBAX Mentor
    Joined
    Nov 2008
    Posts
    305
    Location

    Automatic alphabetic scrolling in a listbox

    If I have a listbox on a worksheet, which has been generated using the List option in Data Validation, how can I get it to automatically scroll throught the alphabet.

    For example if I have a list the contains 10 items, and the eight item is "Mars" If the user activates the cell, and then begins to type M (it rolls down to words that start with M.
    If the user then types A, it rolls through to words starting with MA.
    And so on and so forth.

    At the moment this isn't an option, how can I get the listbox to do this?

    (Using Excel 2003)
    Note this is on a worksheet, not a listbox on a form.

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    A combobox has this facility. Is your data ordered? If not you can order it and add it using the List metthod. See the example here
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Mentor
    Joined
    Nov 2008
    Posts
    305
    Location
    If you look at the attached Excel workbook,
    The Worksheet data contains the days of the week, listed alphabetically.
    The other worksheet contains a listbox (created from the Data Validation menu) in field A1.

    All I want is for the user to be able to (for example) type M in the field A1, and it will automatically roll to Monday.

    If the user begun to Type T, it would show Thursday, if they then typed U, it would show Tuesday (combining T and U).

    Is this not possible using this function, Do I have to use a combobox?

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    What you have is data validation, not a listbox.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Mentor
    Joined
    Nov 2008
    Posts
    305
    Location
    Fair enough,
    Is it possible to have a similar function for data validation, or would I need to create a ListBox of ComboBox.

  6. #6
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    This was given to me once, you may be able to adapt it to your needs.
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

Posting Permissions

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