|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
EXCEL VBA - Transfer Data from 1 Multicolumn listbox to another on the same userform
Please Help!! I have a userform which contains a MULTICOLUMN listbox with data from a worksheet. When the user selects an entry (dbl clicks) I want the entry to be tranferred to the second MULTICOLUMN listbox right below it. I can successfully transfer the appropriate data, but in the second listbox, it adds all the data in the first column. How do I get it so the data appears across the columns (ie. as it is in the first listbox)??? I think the answer is simple but I am not seeing it. An array perhaps?? Here is the code I have presently...
With lboMICHNAME For i = 0 To lboMICHNAME.ListCount - 1 If lboMICHNAME.Selected(i) = True Then For x = 0 To lboMICHNAME.ColumnCount - 1 lboMICHsummary.AddItem .List(i, x) Next x End If Next i End With |
|
#2
|
||||
|
||||
|
Remember that every time you add an item, it add a new row in the listbox. Try this:
Code:
Dim iIndex
Dim iInd2
With lboMICHNAME
iIndex = lboMICHNAME.ListIndex
lboMICHsummary.AddItem .List(iIndex, 0), 0
iInd2 = lboMICHsummary.ListCount - 1
For x = 1 To lboMICHNAME.ColumnCount - 1
lboMICHsummary.List(iInd2, x) = .List(iIndex, x)
Next x
End With
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > EXCEL VBA - Transfer Data from 1 Multicolumn listbox to another on the same userform |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|