Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Listbox help.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="JLGWhiz, post: 6415675"] After checking the code for multiselect, I realized that it would not work as written. Here is a tested macro that does work: Private Sub UserForm_Click() x = 1 For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then ActiveSheet.Range("A" & x) _ = ListBox1.List(i) End If x = x + 1 Next End Sub Note that it uses UserForm_Click instead of ListBox1_Click. That is because with multiselect the listbox click event is disabled so you can make the multiple selections. You might want to adapt the code to a command button. Otherwise, once the selection is made, just click on the form outside the listbox and the code should execute. [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Listbox help.
Top