Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old August 20th, 2003, 11:10 PM
nursejames nursejames is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 3 nursejames User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old August 25th, 2003, 03:36 AM
Silian's Avatar
Silian Silian is offline
Gogga
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 198 Silian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > EXCEL VBA - Transfer Data from 1 Multicolumn listbox to another on the same userform


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway