ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiselect Listbox (https://www.excelbanter.com/excel-programming/314573-multiselect-listbox.html)

Francis Ang[_3_]

Multiselect Listbox
 
I have a listbox with with its properties set to mutliselect and is popupated
with "Apples, Oranges, Peaches, Grapes, Apricot and Guava.

When the user select say, Oranges and Grapes, I want these to be displayed
but do not know how to write the code. I have looked at previous postings
but the responses only dealt with showing the listindex value instead of the
actual description. Can someone help!

Tom Ogilvy

Multiselect Listbox
 
With Userform1
rw = 1
for i = 0 to .Listbox1.Listcount - 1
if .listbox1.Selected(i) then
cells(rw,1).Value = .listbox1.List(i)
rw = rw + 1
end if
Next
End with

--
Regards,
Tom Ogilvy

"Francis Ang" wrote in message
...
I have a listbox with with its properties set to mutliselect and is

popupated
with "Apples, Oranges, Peaches, Grapes, Apricot and Guava.

When the user select say, Oranges and Grapes, I want these to be displayed
but do not know how to write the code. I have looked at previous postings
but the responses only dealt with showing the listindex value instead of

the
actual description. Can someone help!




Francis Ang[_3_]

Multiselect Listbox
 
Thank you very much Tom. Really appreciate your help.


"Tom Ogilvy" wrote:

With Userform1
rw = 1
for i = 0 to .Listbox1.Listcount - 1
if .listbox1.Selected(i) then
cells(rw,1).Value = .listbox1.List(i)
rw = rw + 1
end if
Next
End with

--
Regards,
Tom Ogilvy

"Francis Ang" wrote in message
...
I have a listbox with with its properties set to mutliselect and is

popupated
with "Apples, Oranges, Peaches, Grapes, Apricot and Guava.

When the user select say, Oranges and Grapes, I want these to be displayed
but do not know how to write the code. I have looked at previous postings
but the responses only dealt with showing the listindex value instead of

the
actual description. Can someone help!






All times are GMT +1. The time now is 02:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com