Consulting

Results 1 to 8 of 8

Thread: InputBox Auto-Complete Function

  1. #1

    Question InputBox Auto-Complete Function

    I have an Excel Workbook which contains several spreadsheets that I use to track data about our RV stock. I use command buttons and companion VBA code to allow users to enter data and assure that the data is placed in the correct locations on the worksheets.

    In a few cases the set of possibilities for the acceptable entries in a given InputBox is relatively small (less than 50). I would like to implement a function which would suggest a complete entry once the user has typed enough characters to make the entry unique in a list of possible entries.

    If anyone has done this or knows how I can acomplish this I would be very greatful for the information.

    Thank you,
    Pat Murphy
    Poulsbo RV

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You should use a combvobox as that can natively support that sort of functionality.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    I have not been able to find anything about this in the VBA help and references that I have. Could you give me the syntax of the method and or a simple example, please?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just add a combobox, and set the MatchEntry property to 0, frmMatchEntryFirstLetter
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi cp,

    Is this an Inputbox in the code or a textbox on a form or sheet?
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

  6. #6
    Inputbox in the code.

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You won't get that with an inputbox. Create a form to simulate an inputbox, but with a combobox on it.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  8. #8
    VBAX Expert
    Joined
    Feb 2005
    Location
    Nanaimo, British Columbia, Cananda
    Posts
    568
    Location
    Hi cpmurphy,

    Here's an example.

    - A Public variable to capture the Form Combobox text.
    - Some fake code with an form disguised as an "inputbox".
    - A msgbox so illustrate that it worked

    Open the Userform in the VBE. Right click on the ComboBox or the Command Button to view many properties...
    Cheers,

    dr

    "Questions, help and advice for free, small projects by donation. large projects by quote"

    http:\\www.ExcelVBA.joellerabu.com

Posting Permissions

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