Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Roy... Thanks you are a star. I will work on this, as it consistently
writes to the last column, but I will get it right from now. If I have a problem I will come back to "royUK" wrote: Try Code: -------------------- Private Sub CommandButton1_Click() Dim lSelected As Long Dim sSelected As String For lSelected = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(lSelected) = True Then If sSelected = Empty Then sSelected = ListBox1.List(lSelected) Else: sSelected = sSelected & ListBox1.List(lSelected) End If 'this line will write to consecutive cells in sheet 2 ' Sheet2.Cells(Rows.Count).End(xlUp).Offset(1, 0) = ListBox1.List(lSelected) ListBox1.Selected(lSelected) = False End If Next MsgBox sSelected End Sub -------------------- -- royUK Hope that helps. RoyUK ------------------------------------------------------------------------ royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=24881 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting subsets using combo boxes or list boxes | Excel Discussion (Misc queries) | |||
Questions on combo boxes and list boxes. | New Users to Excel | |||
Combo/List Boxes | New Users to Excel | |||
Filtered list for Combo Box ListFillRange - Nested Combo Boxes | Excel Programming | |||
List boxes/combo boxes | Excel Programming |