Excel List Box Output

geekette

Board Regular
Joined
Sep 12, 2006
Messages
120
Hi,

I have created a list box using the Control Toolbox. It's Listfill range is looking up a named range I have created called LOOKUP_Skills. I have set it to Multi select items.

What I now need to do is output any items selected in the list to another range in my workbook so I can then run a query based on these selections. I have been reading lots of online advice but all seem to point to list boxes that have been created on user forms.

Any help would be very happily received :O)
 
I've removed that but now get an error message at this part of the code:

Set DestCell = .Range("G" & inextrow)

"Application Defined or Object Defined Error"

?
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I'm sorry I'm not sure.....(I'm not best at vba :O( )

I copied the code and the only parts I have amended were the reference to sheetname and list box all other code I left untouched so I'm not sure how I would/should declare anything within the code?
 
Upvote 0
Try:

Rich (BB code):
Private Sub ListBox1_Change()
    Dim inextrow As Long
    Dim DestCell As Range
    Dim iCtr As Long
    inextrow = 2
    With Sheets("View My Requests")
        Set DestCell = .Range("G" & inextrow)
    End With
    With Me.ListBox1
        DestCell.Resize(.ListCount, 1).ClearContents
        For iCtr = 0 To .ListCount - 1
            If .Selected(iCtr) Then
                DestCell.Value = .List(iCtr)
                Set DestCell = DestCell.Offset(0, 1)
            End If
        Next iCtr
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,892
Messages
6,122,112
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top