PC Review


Reply
Thread Tools Rate Thread

Adding items to the second column of a list box

 
 
mika
Guest
Posts: n/a
 
      24th Nov 2003
Hi,

I have a 2-column list box, but I can't figure out how to
add items to the second column. Any help would be greatly
appreciated.

Thanks,
Mika
 
Reply With Quote
 
 
 
 
Tom Ogilvy
Guest
Posts: n/a
 
      24th Nov 2003
if you are using the rowsource or listfillrange, just set the reference to
two columns

Sheet1!A1:B20

Also, set the columncount property to 2

if not, how are you populating the listbox?

--
Regards,
Tom Ogilvy

"mika" <(E-Mail Removed)> wrote in message
news:56bd01c3b2cc$fde76a20$(E-Mail Removed)...
> Hi,
>
> I have a 2-column list box, but I can't figure out how to
> add items to the second column. Any help would be greatly
> appreciated.
>
> Thanks,
> Mika



 
Reply With Quote
 
mika
Guest
Posts: n/a
 
      24th Nov 2003
Hi,

I am populating from a one dimensional array.

I have two one dimensional arrays, so I want to populate
the first column with values from the 1st array, and the
second coumn with values from the 2nd array.

Thanks,
mika
>-----Original Message-----
>if you are using the rowsource or listfillrange, just set

the reference to
>two columns
>
>Sheet1!A1:B20
>
>Also, set the columncount property to 2
>
>if not, how are you populating the listbox?
>
>--
>Regards,
>Tom Ogilvy
>
>"mika" <(E-Mail Removed)> wrote in

message
>news:56bd01c3b2cc$fde76a20$(E-Mail Removed)...
>> Hi,
>>
>> I have a 2-column list box, but I can't figure out how

to
>> add items to the second column. Any help would be

greatly
>> appreciated.
>>
>> Thanks,
>> Mika

>
>
>.
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      25th Nov 2003
One way:

Private Sub UserForm1_Initialize()

Dim myArr1 As Variant
Dim myArr2 As Variant
Dim iCtr As Long

myArr1 = Array("a", "b", "c", "d")
myArr2 = Array("1", "2", "3", "4")

With Me.ListBox1
.ColumnCount = 2
For iCtr = LBound(myArr1) To UBound(myArr1)
.AddItem CStr(myArr1(iCtr))
.List(.ListCount - 1, 1) = myArr2(iCtr)
Next iCtr
End With

End Sub

mika wrote:
>
> Hi,
>
> I am populating from a one dimensional array.
>
> I have two one dimensional arrays, so I want to populate
> the first column with values from the 1st array, and the
> second coumn with values from the 2nd array.
>
> Thanks,
> mika
> >-----Original Message-----
> >if you are using the rowsource or listfillrange, just set

> the reference to
> >two columns
> >
> >Sheet1!A1:B20
> >
> >Also, set the columncount property to 2
> >
> >if not, how are you populating the listbox?
> >
> >--
> >Regards,
> >Tom Ogilvy
> >
> >"mika" <(E-Mail Removed)> wrote in

> message
> >news:56bd01c3b2cc$fde76a20$(E-Mail Removed)...
> >> Hi,
> >>
> >> I have a 2-column list box, but I can't figure out how

> to
> >> add items to the second column. Any help would be

> greatly
> >> appreciated.
> >>
> >> Thanks,
> >> Mika

> >
> >
> >.
> >


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding selected items from one list box to two different list boxe Genix Microsoft Excel Programming 6 13th Mar 2009 03:48 AM
Help, please, adding on to items in a column... Uncle Vinnie Microsoft Excel Discussion 5 10th Jul 2008 04:02 AM
Adding items in one row if criteria in another column is met. migpics Microsoft Excel Programming 0 7th May 2008 09:20 PM
Adding items in a column if value in a second column is X. paulkaye Microsoft Excel Discussion 7 15th Jan 2008 03:06 PM
Adding Subject Column to Sent Items Folder =?Utf-8?B?am9lbGhvaA==?= Microsoft Outlook Installation 2 26th Apr 2006 02:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:40 AM.