Hi all,
i'm trying to set up a code which allow me to copy the selected items in a listbox and to past them in some cells in excel.
the problem is that i don't know the code to "explain" that the selected item has to be copied and pasted somewhere in the open sheet.
I tried this but it does not wotk . is there someone able to help me please?
actually i do not know how to write the code to explain that i need to copy the selected value and subsequently to paste it in a cell in excel.
Private Sub CommandButton1_Click()
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
ActiveSheet.Range("a1").End(xlDown).Offset(1, 0).Select = ListBox1.Text
Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=False, Transpose:=False
End If
Next
End Sub
thanks a lot, bye
i'm trying to set up a code which allow me to copy the selected items in a listbox and to past them in some cells in excel.
the problem is that i don't know the code to "explain" that the selected item has to be copied and pasted somewhere in the open sheet.
I tried this but it does not wotk . is there someone able to help me please?
actually i do not know how to write the code to explain that i need to copy the selected value and subsequently to paste it in a cell in excel.
Private Sub CommandButton1_Click()
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) = True Then
ActiveSheet.Range("a1").End(xlDown).Offset(1, 0).Select = ListBox1.Text
Selection.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=False, Transpose:=False
End If
Next
End Sub
thanks a lot, bye