|
Private Sub CommandButton1_Click()
Dim temp As Range
Set temp = ActiveWindow.ActiveCell
temp = ListBox1.List(ListBox1.ListIndex, 0)
temp.Offset(0, 1) = ListBox1.List(ListBox1.ListIndex, 1)
temp.Offset(0, 2) = ListBox1.List(ListBox1.ListIndex, 2)
temp.Offset(0, 3) = ListBox1.List(ListBox1.ListIndex, 3)
Set temp = Nothing
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim temp As Range
Set temp = ActiveWindow.ActiveCell
'MsgBox ListBox1.List(ListBox1.ListIndex, 0)
'MsgBox ListBox1.List(ListBox1.ListIndex, 1)
temp = ListBox1.List(ListBox1.ListIndex, 0)
temp.Offset(0, 1) = ListBox1.List(ListBox1.ListIndex, 1)
temp.Offset(0, 2) = ListBox1.List(ListBox1.ListIndex, 2)
temp.Offset(0, 3) = ListBox1.List(ListBox1.ListIndex, 3)
Set temp = Nothing
End Sub
Private Sub UserForm_Activate()
Dim Arr0
Dim MRow As Integer
MRow = Sheet3.Range("b" & Rows.Count).End(xlUp).Row + 1
Arr0 = Sheet3.Range("a2:d" & MRow)
ListBox1.List = Arr0
End Sub
|
|