How to retrieve data from unbound listbox.

I'm trying to retrieve data from a multi-column, unbound listbox.

Suppose you create a simple unbound listbox with 2 columns.

Then use the following to fill the listbox:

ListBox1.AddItem("a;1")
ListBox1.AddItem("b;2")

Suppose the user highlights the second row, the one with a "b" in the
1st column. How would I retrieve the data in column 2 (in this case a
2)?
0
cr113
12/17/2009 8:59:02 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
1381 Views

Similar Articles

[PageSpeed] 38

On Thu, 17 Dec 2009 12:59:02 -0800 (PST), cr113 wrote:

> I'm trying to retrieve data from a multi-column, unbound listbox.
> 
> Suppose you create a simple unbound listbox with 2 columns.
> 
> Then use the following to fill the listbox:
> 
> ListBox1.AddItem("a;1")
> ListBox1.AddItem("b;2")
> 
> Suppose the user highlights the second row, the one with a "b" in the
> 1st column. How would I retrieve the data in column 2 (in this case a
> 2)?

Retrieve it where? And do what with it?
As the control source of an unbound control:
=[ListBoxName].Column(1)

List boxes (and Combo Boxes) are Zero based. Column(1) is the 2nd
column.
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
fredg
12/17/2009 9:37:26 PM
On Dec 17, 3:37=A0pm, fredg <fgutk...@example.invalid> wrote:
> On Thu, 17 Dec 2009 12:59:02 -0800 (PST), cr113 wrote:
> > I'm trying to retrieve data from a multi-column, unbound listbox.
>
> > Suppose you create a simple unbound listbox with 2 columns.
>
> > Then use the following to fill the listbox:
>
> > ListBox1.AddItem("a;1")
> > ListBox1.AddItem("b;2")
>
> > Suppose the user highlights the second row, the one with a "b" in the
> > 1st column. How would I retrieve the data in column 2 (in this case a
> > 2)?
>
> Retrieve it where? And do what with it?
> As the control source of an unbound control:
> =3D[ListBoxName].Column(1)

That's exactly what I needed.

Thanks!
0
cr113
12/17/2009 10:03:45 PM
Reply:

Similar Artilces:

How can I blank a cell until a ref cell has the correct data?
I am creating a worksheet. The date is entered in, lets just say A1 for the beginning of the week starting on Saturday. The results are the "mon & day" for each of the seven days for the week by ref cell A1 and using "=A1+1", "=A1+2, etc., to finish off the week. When there is no date in the ref cell (A1), the results are "1/0 1/1 1/2 1/3 1/4 1/5 1/6". How can I hide this or keep these results from appearing and only appearing when a valid date is entered into A1? Thanks for any help.... =IF($A$2>1,A$2+1,""). Puts a NULL in...

Importing null data into Excel
We have a DAT file that contains an empty column. Version 97 imported it fine, but 2003 removes the column throwing off my reports. Any ideas on how or why it's doing this? Thanks ...

3.0 Data migration framework still only one time load?
Just wondering if the new framework can do repeat data loads or is it still a one time only process (i.e. no incremental data loading after the first load). Thanks, ...

Retrieve RGB values of Even Row Banding of User-Defined Table Style
Dear Experts: I got a user-defined table style that has an even row banding (red), i.e. the selected table gets alternately shaded in red/white. The user- defined table style is called (tbl_style_red) Is it possible to retrieve the RGB values (Red/Green/Blue) of the even row banding of this user-defined table style and display the values in a msgbox. Help is much appreciated. Thank you very much in advance. Regards, Andreas ...

Retrieve value from Combo Box and Radio Button
Hi, I have two questions about Excel VBA and hope any experts can give me a hint (1) I wonder how to retrieve automatically the previously saved values from the combo box and a group of radio buttons whenever I open the workbook? (2) Everytime I need to insert an object, I copy the object to one worksheet (named as SLD) from another worksheet (named as Lib) which acts like a library. However, because of using the function "SELECT", I encounter "flickering" on the main sheet (named as Sheet1) each time an object is inserted. Is there any way that I coul...

parsing cell data
Here is my question: I have two cells, side by side on the same row. One has an amount in it, the other has a list of names, comma delimited. I need to transpose the names so that there is one row per name, with the amount next to it (same amount for each row). How can I start this going? Thanks much. Use data>text to columns, delimited and comma as delimiter, make sure you have as many empty column to the right as there are names, then click finish. Now copy all the cells with the parsed names, select the first cell where you want them to start and do edit>paste special and select ...

How do I convert columns of data to rows in excel?
I am trying to convert 1 column of data into a row. Is there a simple way to do this? Copy/Cut your row and rightclick the destination. Choose "Paste Special" and check the "Transpose" option. That should do it! -- -SA "Glen in Pen" wrote: > I am trying to convert 1 column of data into a row. Is there a simple way to > do this? I just tried the Cut/Paste Special... and it's not available. You can only do this using the Copy function. Weird... -- -SA "StumpedAgain" wrote: > Copy/Cut your row and rightclick the destination....

Powerpoint 2007 SP2 crashing when importing data
My user's are experiencing crashes when importing data from another program. From Word or Excel, and it may be multiple issues. No error, the program just locks up for 5-10 minutes, and then crashes. Sometimes, office-kb975021-fullfile-x86-glb.exe fixes importing from Excel. Other times, MicrosoftFixit50352.msi will fix importing from Word. Other times, nothing will fix this. From what I'm reading in some basic Google searches, this may have come up with one of the updates included with SP2. Some suggestion even call for removing SP2, either with a utility of ma...

Restoring Outlook data from system backup
It was time to clean up years of crud on the hard drive, so I decided to do a reformat and re-install. I copied eveything I might need meticulously...except I forgot to export my Outlook data to a .pst. So, short of completely starting over by restoring my entire system from the system backup and then exporting the .pst, what folders within the system backup need to be selectively restored to retrieve emails and calendar? In my case, especially calendar. Thanks, Jim Eilers jim@jreilers.org All Outlook data is stored in a PST file. There was no need to export anything. Just find and ...

Referencing Data Filter to a cell value
i am having continuing problems with the following: I have a spreadsheet which lists project status. One of the columns shows the installation subcontractor. I want to have a drop down box where you select the contractor, and once selected, the list automatically (or by use of a macro button) filters to that selected. I have put the drop down box in, then created a vlookup to convert each contractor to a number, and placed a hidden column with this info. Where i am stuck is how i get the data filter to look at my link cell from the drop down box. Any help is appreciated Richard R...

Varbinary(Max) Data compression
I need to compress hudge files (PDF + TIFF) stored in a varbinary field. I found in BOL that :" Because of their size, large-value data types are sometimes stored separately from the normal row data on special purpose pages. Data compression is not available for the data that is stored separately." How do I compress those fields? Gal (Gal@discussions.microsoft.com) writes: > I need to compress hudge files (PDF + TIFF) stored in a varbinary field. I > found in BOL that :" Because of their size, large-value data types are > sometimes stored separately f...

xml transforms to rearrange worksheet data?
xl2010 Anyone here familiar with using xml transforms to massage xl data? I have an inherited spreadsheet I'd like to use a pivot table on, but it is not organized as a list, or table. Seems like I've read that xml transforms can be used to manipulate how data is presented; I'm wondering if I can use a transform to create a new worksheet with the data re-arranged into proper rows and columns. I've no idea even where to start looking for information --- anyone have some links or pointers for me? TIA! -- Clif McIrvin (clare reads his mail with moe, nomail feeds the bit...

Deleting data entries but not formats
Hi newsgroup, I have some trouble with excel... and with a document which I use for serial mails via Mail Merge. Now I need to clean all old data entries and prepare it for the next use. But if I simply delete the entries or do it via Clear-Entries then I have problems because conditional formatting will also be deleted and furthermore the mail merge cant work anymore because some fields are not found anymore. Does someone know how I can only delete the data entries, nothing else? The Mail merge runs via SQL and I'm not quite good in it... Thanks a lot in advance and a nice weeken...

Put excel data on a US map
I have sales force data(ie, salesman, customer, customer location, 09 sales, 10 sales, etc) and I would like to have the data display on a us map. Something that would make smaller or larger balls based on sales dollars, with the salespersons name and customer name, and have the ball show up where the customer is in the US. Is there software like this? maybe this http://www.mapping-tools.com/mappoint2010/ -- Gary Keramidas Excel 2003 "JJBear" <JJBear@discussions.microsoft.com> wrote in message news:755C0D96-C4AC-4231-B9BC-7D32F01AF573@microsoft...

bar charts don't udate when data is changed-why?
I inherited a spreadsheet with data on sheet 1 and an Excel-generated bar chart on sheet 2. The table is NOT a pivot table. When I change data in the table, the bar chart never updates. I am relatively new to Excel. What am I missing? Hi, The updated data is probably outside the old data range. You can check that by temporarily replacing one of the entries that is being plotted correctly. If that's the problem you need to extend the plot ranges. There are other possibilities. cheers, Shane "JustSomeGuy" wrote: > I inherited a spreadsheet with data on sheet 1 a...

X axis collapsing to date on hourly data
Hello, I have a spreadsheet I am trying to chart that has values by date and time, IE Date-Time, Value 9/17/07 20:00, 1 9/17/07 21:00, 2 9/17/07 22:00, 4 9/17/07 23:00, 1 9/18/07 00:00, 2 9/18/07 01:00, 1 9/18/07 02:00, 0 When I highlight all of the above and select "Insert Chart" and choose line chart, it creates the chart as if it had the following information: Date-Time, Value 9/17/07, 8 9/18/07, 3 It also looks more like a bar chart then a line chart. Anyone have an idea on why this would happen and how to fix it? -Jason I am mistaken, it is collapsing into all 24 series...

How can I save a data file in Access?
I have to format and reinstall XP and other programs in my Aunt's computer and she has an address list saved in Access and I haven't worked with that program. How can I save that list and put it back where it was after I reinstall the OS? Tahnks...... JCW "JCW" <jcw@nowhere.net> wrote in message news:eROEitBiHHA.596@TK2MSFTNGP06.phx.gbl... > I have to format and reinstall XP and other programs in my Aunt's computer > and she has an address list saved in Access and I haven't worked with that > program. How can I save that list and put it back whe...

Extender-Create a new data entry window
Is it possible to create a new extender form or window (not sure of the terminology) to enter data into Dynamics? Specifically the Sales Forecast Window in Manufacturing is terrible for entering data, everytime you move to the right, it the scrolling window jumps back to the top and you have to find the item again. Anyway, I would like a new window to enter a sales forecast, is this possible? thanks -- Doug Unfortunately Extender data is stored in Extender tables and cannot be stored in the Sales Forecast tables. I agree with you that the data entry screen is horrible. I am tal...

In Access 2007, how do I get a chart to reflect table data?
Am not sure how to get charts to reflect table data. It appears that you can create charts in forms and reports, and there's a chart wizard in which I select a table and fields, but the resulting chart does not have table data in it. Any suggestions? ...

Updating a query criteria from a listbox
Hi, I've written a query that is dependent on a date selected from a listbox the result from the listbox is linked to the querie as follows: [forms]![Main Menu]![Date_Select] This works great when I clickthe button that loads the subform that uses the results from this querie... However when I select a different date in the listbox and click again the new date is not being passed down to the querie. I've tried everything I know and it just doesn't want to work... The listbox is linked to a table containing all the dates to be displayed - if that makes any difference. Any h...

transfer of data
Is there a way to transfer data that is in outlook to an exce spreadsheet. I have name, address, city, state, zip, all phone numbers that I woul like to send to certain cells in a spreadsheet. If this is possible, what code could I write help me do this? :confused: Thank You Michae -- Message posted from http://www.ExcelForum.com Hi in Outlook you can save your data as *.csv file. Open this exported file in Excel -- Regards Frank Kabel Frankfurt, Germany "daniels012 >" <<daniels012.1byt7v@excelforum-nospam.com> schrieb im Newsbeitrag news:daniels012.1byt7v@excel...

Data transformation problem
Hi everyone, I hope someone can help me with this data transformation problem, because I'm working with a big enough dataset that I really don't want to do this by hand (I have neither the time nor the finances). I am using Excel 2003. I have a dataset that looks like this (n=231): subjid jobtitle site dur1 to dur243 freqwk1 to freqwk243 1 A A 30... 15 5...10 2 B A 3 C A 4 A B 5 B B 6 C B In other words, this is a dataset holding the survey responses of 231 par...

linking Access data to calendar
I've got a small Access database which holds client information about services they use with our company. Some of these services have to be renewed annually and it would be great if I when I enter in the database that a client has paid for a service, that a renewal reminder could be added into my Outlook calendar for a year later. Is this possible, if so can anyone point me in the right direction of how to do it please? Using Office 2003. (Also have small business server and exchange if needed) Thanks Vix Nothing like that is built in. You'd have to build or buy it. See = htt...

automatically drop data to next line
I have a cell that looks like this John Doe 123 N. 1st Street Miami, FL 12345 Is there a formula, or something I can do to get it to look like this John Doe 123 N. 1st Street Miami, FL 12345 Without having to go through and press enter and resize all of the column widths. I swear I've seen something that looks like a little box that you can put between things in a cell that will make it automatically drop to the next line. Thanks!! Hi Excel can do this in a round-about way, but it needs to know where yo want the line breaks. If your cell said John Doe, 123 N. 1st Street, Mi...

Linest Poly Array using data horizontally
All of our metrics store data horizontally, meaning Months (x) are stored by column and data series (y) are stored in rows below the months... Mo: 1 -- 2 -- 3--4 -- 5 Data 31 -- 33 -- 36 -- 38 -- 39 When I apply any Order Poly Linest() array on the data set, I get errors. Tranpose the data vertically and the Linest() array works. Any advice? I expect you had something like =LINEST(B3:K3,B2:K2^{1,2}) but the comma between 1 and 2 is appropriate for vertical (columnar) data. For horizontal data (data in rows) you need a semicolon (I hope you are using an English version of XL!!) as in =...