Making 2/more selections using button?

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi everyone,

I use ComboBox button to make a selection on graphs A, B, C,.....etc.; one at a time

How can I make ComboBox button accept more than one selection; 2 or more?

Thanks,
Mike
 
How about using a listbox?

You can set that to allow multiple selections.
 
Dave Peterson said:
How about using a listbox?

You can set that to allow multiple selections.

Ya, I know what do you mean. However, I have my chart on one sheet
while the table on a 2nd sheet! I want to be able to do it on the
chart sheet without going back to the table sheet.

Is this doable?

Mike
 
Without understanding what you're doing <bg>...

If you could do it using a combobox (one choice), I would think a listbox would
be possible.

How did you populate the combobox?

What kind of combobox did you use (from the forms toolbar or from the control
toolbox toolbar)?

If you used a linked cell with your combobox, you'll need a little code for the
listbox. And depending on the type of listbox you'll use, the code is
different.
 
Dave,

If you have an email I can send you the file. I have used cell link I
beleive.

(e-mail address removed)

Thanks,
Mike
 
If you post your details in the newsgroup, you'll get an answer quicker and
it'll be reviewed by lots of people.
 
Dave Peterson said:
How about using a listbox?

You can set that to allow multiple selections.


Hi again,

Here is how I have the table on one sheet:

No InModel Resp Depl AgVr Leth
1 1 0.743 0.507 0.589 0.502
2 1 0.713 0.507 0.594 0.543
3 1 0.635 0.507 0.594 0.452
4 1 0.744 0.521 0.589 0.593
5 1 0.609 0.507 0.594 0.643
6 1 0.660 0.704 0.669 0.814
7 1 0.715 0.528 0.594 0.543
8
9
10
11
12
13
14
15
16
17
18
19
20

On a 2nd sheet, I have the chart where as many as 20 solutions could
be graphed. Now, on the 2nd sheet, I want to find a way to scroll
through solutions 1-by-1 or even show 2 ro more at a time WITHOUT the
need of visiting of the table sheet at all?

How can I do so?

Regards,
Mike
 
First, I don't do much with charts. You may want to post specific Charting
questions to the .charting newsgroup.

But I put used controls from the control toolbox toolbar and placed them on
Sheet1.

I used a listbox and a commandbutton.

This is the code that I used to find out what was selected in that listbox.

Option Explicit
Private Sub CommandButton1_Click()
Dim iCtr As Long
Dim myStr As String
Dim cCtr As Long

With Me.ListBox1
For iCtr = 0 To .ListCount - 1
myStr = ""
If .Selected(iCtr) Then
'do your graphing
'just for testing
For cCtr = 0 To .ColumnCount - 1
myStr = myStr & ";" & .List(iCtr, cCtr)
Next cCtr
If myStr <> "" Then
myStr = Mid(myStr, 2)
MsgBox myStr
End If
Else
'do nothing
End If
Next iCtr
End With
End Sub

Private Sub Worksheet_Activate()

Dim myRng As Range
With Worksheets("sheet1")
Set myRng = .Range("B2:F" & .Cells(.Rows.Count, "B").End(xlUp).Row)
End With


With Me.ListBox1
.MultiSelect = fmMultiSelectMulti
.ColumnHeads = True
.ColumnCount = 5
.ListFillRange = myRng.Address(external:=True)
End With

End Sub

I chose to use worksheet_activate to populate the listbox. This means that you
have to leave the sheet and return to it to have it updated. You may want to
use a different method (workbook_open???).

Good luck on the .charting questions.
 

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

Back
Top