PDA

View Full Version : InputBox Auto-Complete Function



cpmurphy1144
07-27-2007, 11:12 AM
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

Bob Phillips
07-27-2007, 11:13 AM
You should use a combvobox as that can natively support that sort of functionality.

cpmurphy1144
07-27-2007, 11:15 AM
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?

Bob Phillips
07-27-2007, 02:47 PM
Just add a combobox, and set the MatchEntry property to 0, frmMatchEntryFirstLetter

rbrhodes
07-29-2007, 03:02 PM
Hi cp,

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

cpmurphy1144
07-30-2007, 06:50 PM
Inputbox in the code.

Bob Phillips
07-31-2007, 12:25 AM
You won't get that with an inputbox. Create a form to simulate an inputbox, but with a combobox on it.

rbrhodes
07-31-2007, 09:35 PM
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...