View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alasdair Stirling[_2_] Alasdair Stirling[_2_] is offline
external usenet poster
 
Posts: 2
Default Excel 2000 Visual Basic - Export Contents of ListBox into a worksh

I am not quite sure what you are trying to do, but this code will spit the
items in a listbox into a worksheet:

Private Sub CommandButton1_Click()
Dim i As Integer
For i = 0 To ListBoxX.ListCount - 1
With ActiveCell
.Value = ListBoxX.List(i)
.Offset(1, 0).Select
End With
Next i
End Sub

You will need to rename ListBoxX according to thae name that you are using.
You also need to identify the Workcheet and Cell address for the ActiveCell
refenence.

Hope this helps

Alasdair Stirling

"Ligaya" wrote:

Hi,

I developed 2 list boxes and succesfully added items to the first ListBox.
I then selected items from ListBox1 to ListBox2. What is the best way to
place the items from ListBox to into another worksheet within the same
workbook.

Thanks.

Ligaya