View Single Post
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

maybe...

Option Explicit
Private Sub CommandButton1_Click()

Dim iCtr As Long
Dim oRow As Long

oRow = 1
With Me.ListBox1
For iCtr = 0 To .ListCount - 1
If .Selected(iCtr) Then
oRow = oRow + 1
worksheets("sheetxxxx").Cells(oRow, "A").Value = .List(iCtr)
End If
Next iCtr
End With

End Sub

Change that sheetxxxx to the correct name.

lu_meihua wrote:

hi, I wish to link the result in a separate worksheet. Where should I
put the code then?? Eg. Cell A2 in worksheet "Sheet2".

In addition, instead of Row, can I link the results across columns
instead?? How do I do that?

Sorry, but I am code-illiterate. Thanks.

==========================
Option Explicit
Private Sub CommandButton1_Click()

Dim iCtr As Long
Dim oRow As Long

oRow = 1
With Me.ListBox1
For iCtr = 0 To .ListCount - 1
If .Selected(iCtr) Then
oRow = oRow + 1
Me.Cells(oRow, "A").Value = .List(iCtr)
End If
Next iCtr
End With

End Sub

--
lu_meihua


--

Dave Peterson