Hi,
i am currently having troubles writing code to copy multiple selected listbox values to a new sheet.what i am hoping to do is to let user select some items in listbox and show the selected name,risk value and cost on sheet 2.the risk value is calculated with a formula(age + length), cost (length+diameter). The code below is what i managed to find at the moment, however it will show all the values of name,risk value,cost,age,length,diameter. if i delete the values of age, length and diameter, the risk value and cost will turn to "0". So i am wondering if there is any code that can copy the info in listbox straight to sheet 2 instead of referring to sheet1.
any help will be greatly appreciated 
Private Sub Commandbutton1_click()
dim a As Long
dim i As Long
a =1
For i = 0 To ListBox1.ListCount - 1
If Listbox1.selected(i) = True Then
worksheets("sheet1").Cells(i+1,1).EntireRow.Copy
Worksheets("sheet2").Cells(a,1).pastespecial
a = a+1
End If
Next i
End sub
sheet 1
name risk value cost age length diameter
a
b
c
d
e
listbox
name risk value cost
a
b
c
d
e
Bookmarks