Hi, As it is not clear where "Range1" and "Range2" are I have Based this on the Ranges in Columns "A" & "B". When you have got it working change the related Addresses to suit your ranges.
If you Show the Userform In "Edit Mode" then Double click on the Userform. You Can paste the entire Codes Below into that Module.
When you select an Item in Either ListBox, it will be deleted from its related range and Listbox and insert in the Other Range and ListBox.
Private Sub ListBox1_Click()
Dim rng, rngB, sert, SertB
Dim Last As Integer
Last = Range("B" & Rows.Count).End(xlUp).Row
Cells(ListBox1.ListIndex + 1, "A").Delete shift:=xlUp
Cells(Last + 1, "B").Value = ListBox1.Value
rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
rngB = Range(Range("B1"), Range("B" & Rows.Count).End(xlUp))
Me.ListBox1.Clear
Me.ListBox2.Clear
For sert = 1 To UBound(rng)
With ListBox1
.AddItem rng(sert, 1)
End With
Next sert
For SertB = 1 To UBound(rngB)
With ListBox2
.AddItem rngB(SertB, 1)
End With
Next SertB
End Sub
'''''''''''''''''
Private Sub ListBox2_Click()
Dim rng, rngB, sert, SertB
Dim Last As Integer
Last = Range("A" & Rows.Count).End(xlUp).Row
Cells(ListBox2.ListIndex + 1, "B").Delete shift:=xlUp
Cells(Last + 1, "A").Value = ListBox2.Value
rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
rngB = Range(Range("B1"), Range("B" & Rows.Count).End(xlUp))
Me.ListBox1.Clear
Me.ListBox2.Clear
For sert = 1 To UBound(rng)
With ListBox1
.AddItem rng(sert, 1)
End With
Next sert
For SertB = 1 To UBound(rngB)
With ListBox2
.AddItem rngB(SertB, 1)
End With
Next SertB
End Sub
''''''''''''''''''
Private Sub UserForm_Initialize()
Dim rng, Rng2
rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
Rng2 = Range(Range("B1"), Range("B" & Rows.Count).End(xlUp))
ListBox1.List = rng
ListBox2.List = Rng2
End Sub
Regards Mick
Bookmarks