Multiselect Listbox/ command button

C

C Wilson

I have a multiselect listbox where users can select different options that
will eventually be graphed. There's is no code for the list options. I used
the properties boxes for the listbox. I want the user to be able to press a
command button after they've finished their selections to graph what they've
selected. Will I need to create a list for the listbox using VB and if so how
do I do that.

Then what code do I use to get the command button to know which items the
user selected?
 
T

Tom Ogilvy

If the user is making selections in the listbox, then it must already have a
list


for the commandbutton

With Listbox1
for i = 0 to .Listcount - 1
if .Selected(i) then
msgbox .List(i) & " is selected"
end if
next
End With
 
C

C Wilson

Thanks for the reply, but that's not quite what I was looking for. I want it
to graph their selections. I know I will have to hide the rows I'm just not
sure how to word it to where it will hide all the data except the selections
they made from the box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top