From ListBox to Excel to TextBox

M

miRNA the great

Dear great people,

Could someone please be kind to help me with my concerns. I have a bi
database in Excel with 20 columns filled and 60000 rows filled. I a
using VBA to organize my database, but I came up with a big problem.
got the listbox to extract the data from the first two columns an
display it as a listbox. Now, the problem is that I want to be able t
click on a listbox value, I should be able to get the correspondin
data from its corresponding row. For example, let's say I have thes
data in ListBox:
1
2
3
4

Now, I have in Excel, on the same row for each number on ListBo
another data I want to display on the textbox if I click on 1, or 2, o
3.... For every time I click on it, I would like to have the other on
deleted and the one we just clicked, displayed on the same textbox.

The data in Excel looks something like this:
A B C
1 _ a
2 _ b
3 _ c
4 _ d

In my case, I would like to click on the listbox for, let's say, 1 an
be able to display on the textbox the letter a. The same concept woul
apply if I click on 10 or 1000. Thank you SO MUCH and please HELP ME!
really do appreciate it.

miRNA the great for your servic
 
J

Jonathan West

Hi mirna

You can obtain the text of any item in a ListBox by using the List(row,
column) property.

The ListIndex property of the listbox gives you the number of the selected
Item. Armed with that you can work out which row to access.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top