Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListBox (?) in a macro
I need, in a macro, an instruction that will display a long list fro which the user can select an item and paste it into the current Activ Cell. For approaching the item wanted I envisage one of those boxes with one-line window, on top of it, for the user to type in character belonging to the item he wants, so that with each character typed th selection bar within the box moves closer and closer to that item. Many thanks in advance to any good samaritan who can help. AC -- ac ----------------------------------------------------------------------- aca's Profile: http://www.msusenet.com/member.php?userid=385 View this thread: http://www.msusenet.com/t-187371404 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListBox (?) in a macro
You need a comboBox. Insert UserForm ( RightClick VBAProject(WorkBook1)Insert Form ). When UserForm1 appears, put a ComboBox on the form from the tools menu that appears. You have designed your form. Put some code like this on your FormCodeSheet to populate the item list of the box. Private Sub Userform_initialize() ComboBox1.AddItem "ABC1" ComboBox1.AddItem "AAC2" ComboBox1.AddItem "ADE3" ComboBox1.AddItem "AAAEF4" ComboBox1.AddItem "ABCDEFG5" ComboBox1.AddItem "BBBB6" End Sub You also need to have a sub to capture the data from combox user selected. This could be Private Sub combobox1_change() UserData=ComboBox1.Text End Sub Both these Subs are on FormCodeSheet You will need one statement in your procedure to display the form UserForm1.Show This will display the form with the ComboBox. User then selects the data he wants. You can hide the form immediately by UserForm1.Hide -- avveerkar ------------------------------------------------------------------------ avveerkar's Profile: http://www.excelforum.com/member.php...o&userid=30338 View this thread: http://www.excelforum.com/showthread...hreadid=505638 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
RollDown ListBox in a macro | Excel Programming | |||
Macro for Control ListBox | Excel Programming | |||
Multiple firing of macro from ListBox | Excel Programming | |||
Run a macro when new selection in listbox | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming |