Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RollDown ListBox in a macro aca[_6_] Excel Programming 0 January 23rd 06 07:59 AM
Macro for Control ListBox Linking to specific cells in pivot table Excel Programming 3 September 27th 05 02:06 AM
Multiple firing of macro from ListBox SteveF Excel Programming 2 December 9th 04 08:21 AM
Run a macro when new selection in listbox Georg[_3_] Excel Programming 1 December 5th 03 06:09 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"