LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default Can't added two columns from one listbox to two columns in another

Hello,

I have one multi-select two column listbox on a userform. I have a button
that will take the selection from the mult-select listbox that has two
columns to another listbox that also has two columns.

Here is my code:

Dim itemIndex As Integer
Dim myVar As Variant
With frmEmployeeMaintenance

.lstClubsAssigned.RowSource = "" 'second listbox

If .lstClubs.ListIndex = -1 Then 'first listbox
Exit Sub
End If

For itemIndex = .lstClubs.ListCount - 1 To 0 Step -1
If .lstClubs.Selected(itemIndex) Then
.lstClubsAssigned.AddItem .lstClubs.Column(0, itemIndex) &
";" & .lstClubs.Column(1, itemIndex)
End If
Next itemIndex
End With


I found this code on a help forum, but it is not working for me. It only
adds a concatenated string to the first column. How do I add values to both
columns?

Thanks,

Tony

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i lock columns but allow for new rows to be added? Dave Peterson Excel Discussion (Misc queries) 0 August 27th 08 04:08 PM
Data is added in 1 column instaed of 4 columns (in listbox) Arjan Excel Programming 1 October 19th 06 01:22 PM
formula to sum the prior 12 cells regardless of added columns? Mopechicken Excel Worksheet Functions 6 October 12th 06 04:20 PM
Added new columns - Pivot Table not refreshing - why? Joan Sims Excel Worksheet Functions 1 January 12th 06 12:31 AM
Sum of Rows when columns are added Robert L. Salisbury Excel Programming 1 January 11th 04 09:40 PM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"