Hi quick question
I have a Listbox that has 2 columns
using Additem how do I place data in the 1st then the 2nd column to create a list.
Regards
Dave
Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.
Hi quick question
I have a Listbox that has 2 columns
using Additem how do I place data in the 1st then the 2nd column to create a list.
Regards
Dave
Re: ListBox 2 column additem
Dave,
In this example I have a list box with 5 columns. The values for each column are filled by a1:e1
ListBox1.AddItem range("a1").value
ListBox1.List(1, 1) = range("b1").value
ListBox1.List(1, 2) = range("c1").value
ListBox1.List(1, 3) = range("d1").value
ListBox1.List(1, 4) = range("e1").value
Hope that helps
Weasel
to make this truly useful you should be looping through data to obtain a dataset of entries. You need to post more info to get more help with that.
Re: ListBox 2 column additem
Dave,
Yes that should add A & B to the list box 10 times.
Regards
Weasel
Re: ListBox 2 column additem
Quote from Dave Taylor;136192Display MoreHi quick question
I have a Listbox that has 2 columns
using Additem how do I place data in the 1st then the 2nd column to create a list.
Regards
Dave
hi
for do this try this cod
Re: ListBox 2 column additem
The threads 9 years old!
Re: ListBox 2 column additem
hi
Thank you for your message.
Yes I Know
But I wrote it for people who come to this page by searching for
Re: ListBox 2 column additem
Wow, well it took a while but thank you for the reply, needless to say that I now can’t remember why I wanted this, but I have noted your reply for future use.
And it is good to reply as you say for people searching, I know I have found answers in many old threads.
Once again thank you
Regards, Dave
Re: ListBox 2 column additem
Quote from Dave Taylor;639563Wow, well it took a .......
Regards, Dave
you are welcome
Re: ListBox 2 column additem
Please don't quote whole posts -- it's just clutter.
If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding.
Don’t have an account yet? Register yourself now and be a part of our community!