|
-
Oct 25th, 2006, 11:58 AM
#1
Thread Starter
Junior Member
Listbox Column Move
Hello
**Confused**
I have 2 multiple column listbox's (listbox1 & 2). I am using a select/drag/drop function to move from listbox 1 to 2. I am attempting to move the selected line (3 columns) of the listbox. Both are set to 3 colums. How do I grab all three columns?
VB Code:
Private Sub ListBox2_BeforeDropOrPaste(ByVal Cancel As _
MSForms.ReturnBoolean, _
ByVal Action As Long, _
ByVal Data As MSForms.DataObject, _
ByVal X As Single, _
ByVal Y As Single, _
ByVal Effect As MSForms.ReturnEffect, _
ByVal Shift As Integer)
Cancel = True
Effect = fmDropEffectMove
Dim I
With ListBox1
For I = 0 To .ListCount - 1
If .Selected(I) Then
ListBox2.AddItem .List(I) <----only 1st item?
End If
Next
End With
-
Oct 26th, 2006, 03:16 AM
#2
Re: Listbox Column Move
Your first column is likely to be the Key ID column. So that is what is added.
To get to the other columns usually you need:
Code:
lstBox.column(0,1) 'first column, first row (data if you have title row)
lstBox.column(1,1) 'second column
lstBox.column(2,1) 'third column
May be slightly different in VB coding, but that should help.
I think it is in the help files/intellisense.
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|