Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a form with two listboxes. I have a button on the form that,
once pushed, i'd like everything from listbox1 to move to listbox 2. help? thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On May 10, 3:08*pm, Matthew Dyer wrote:
I have a form with two listboxes. I have a button on the form that, once pushed, i'd like everything from listbox1 to move to listbox 2. help? thanks! I figured it out :-). For those curious, here is my solution: Private Sub CommandButton2_Click() Dim i As Integer i = 0 Do Until ListBox1.ListCount = 0 ListBox2.AddItem ListBox1.List(i) ListBox1.RemoveItem i Loop End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
You don't say whether LIstbox2 contains anything that should be kept, so assuming not: Private Sub CommandButton1_Click() Me.ListBox2.List = Me.ListBox1.List Me.ListBox1.Clear End Sub HTH. Best wishes Harald "Matthew Dyer" wrote in message ... I have a form with two listboxes. I have a button on the form that, once pushed, i'd like everything from listbox1 to move to listbox 2. help? thanks! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Matthew Dyer wrote on 5/10/2011 :
I have a form with two listboxes. I have a button on the form that, once pushed, i'd like everything from listbox1 to move to listbox 2. help? thanks! try... With Me.ListBox1 ListBox2.List = .List If .RowSource < "" Then .RowSource = "" Else .Clear End With -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prevent Coping/Transffering item twice from Listbox1 to Listbox2 | Excel Programming | |||
ListBox2.AddItem ListBox1.Value becomes a String when being Integer? | Excel Programming | |||
Listbox1 to Listbox2? | Excel Programming | |||
Userform - Populate Listbox2 based on selection in Listbox1 | Excel Programming | |||
(Worksheet)Listbox1.additem = (Form)Listbox1.value ?? | Excel Programming |