Data available for plotting vs already plotted data

L

L Mehl

Hello --

This charting application has the following features:

1 - user can "import" a time series (into a set of columns in a worksheet);
the app automatically adds a plot of the data to the chart

2 - user can delete from the chart a series which was plotted in 1; the
source data is not deleted from the worksheet which holds it

3 - user can decide later to add to the chart a series deleted in 2

Problem:
I want to present in a listbox the names/legends of the "imported but not
plotted" series so the user can select one for 3

If I could use SQL in this app, the source for the listbox would look
something like:

SELECT name_Imported FROM tblImported
WHERE name_Imported NOT IN (SELECT name_Plotted FROM tblPlotted)

Each "tbl..." would be a range in one of the application's worksheets, and
filled by a process I don't know how to code.

Can anyone suggest how to populate such a listbox?

Thanks for any help.

Larry Mehl
 
J

Jon Peltier

Larry -

I think I would dynamically manage the list. When the data is added to
the worksheet, I'd add it to the list; when it's plotted, I'd remove it;
when it's deleted from the chart, I'd add it back. For easier
maintenance I'd probably hide the list in a worksheet somewhere.

You could also build a list by adding all the worksheet ranges which are
eligible to plot, then see what's in the chart, and remove all the
series that are plotted.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
L

L Mehl

Jon --

Thank you for suggesting those methods.

I ended up doing it in the same workbook, populating the listbox when
needed, using code similar to:

blnMatchFound = False

For aLoopDefinition 'loop through imported
'get fileNameImported
blnMatchFound = False
For bLoopDefinition 'loop through plotted
'get fileNamePlotted
If fileNameImported = fileNamePlotted Then 'filenames match
blnMatchFound = True
Exit For
End If
Next bLoopValue '.b.
If blnMatchFound = False Then
'add to listbox
End If
Next aLoopValue '.a.

Larry
 

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