473,463 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to get the values from MultiSelect listbox?

Hello, I am new to Excel Macro programming, infact fresher.

I want to get the multi select values from the list box which has multiple columns.

For Example;

User Form List Box shows like below

Col1 Col2
1122 John
1113 Ma

ry
1123 Mike

Upon select of values i,e. 1122 John
I wany shore that value and show in some ComboBox.

Can you please help me with the exact Code for the same.

Thanks inadvance.
Jan 26 '11 #1
1 4633
horace1
1,510 Expert 1GB
in the ListBox properties you change SelectionMode to MultiSimple or MultiExtended then when the index is changed (an item selected) you go thru the items selected
In the following I have a ListBox and a TextBox
as I select item in the ListBox the items selected are displayed in the textbox
Expand|Select|Wrap|Line Numbers
  1.     Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
  2.         TextBox1.Text = "Here are the selected items: "
  3.         For Each Item In ListBox1.SelectedItems
  4.             TextBox1.Text &= Item.ToString() & " "
  5.         Next
  6.     End Sub
  7.  
using Visual Studio 2008
Jan 26 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: arthur-e | last post by:
Hi I'm trying to use a multiselect listbox to limit records in a report. My version at work is 97 but now at home I'm using Access2002- I know I can't go backwards ( to use this or similar code at...
2
by: Sally | last post by:
I have a simple multiselect listbox with a rowsorce of MemberID, MemberName, SendLetter. SendLetter is a Yes/No field. What is the code to set SendLetter to Yes when the user selects MemberName? I...
2
by: Sally | last post by:
In a simple multiselect listbox, what is the code to return an item's index when it is selected? Thanks! Sally
2
by: Cassie Pennington | last post by:
I am trying to write various items from a multiselect list box to an SQL statement to update a report, without success. SQL only appears to accept hard-coded data or control values from a form, not...
1
by: | last post by:
I am having trouble getting the procedure to use a Multiselect listbox in a report to work. I am using Access 2000. Here's the code. The error I get is QueryDef "User-defined type not...
2
by: Peder Y | last post by:
Anyone knows if there is some kind of property or function that will return the last selected/deselected item/index in a multiselect ListBox? SelectedIndex will point to first index in the...
1
by: Mike P | last post by:
How do I get the values selected from a multiselect listbox? Cheers, Mike *** Sent via Developersdex http://www.developersdex.com ***
2
by: ttime | last post by:
I've got a form that uses a multiselect listbox. When a user is selected from a combo box, values are populated into this listbox associated with that user. The problem is, if one person has say...
3
by: kaosyeti via AccessMonster.com | last post by:
hey... i have an unbound multiselect listbox on a form that i want to use to populate text boxes on that form. so if a user selects the 3rd item in a list of 20, how can i have that item show up...
5
by: martin DH | last post by:
Hello, The details are below, but I have a simple form (Form1) with two objects and a "search" command button. When the two objects are cascading combo boxes (the form creates the parameters for a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.