Pull-down list for chart filter?

  • Thread starter Thread starter Dallman Ross
  • Start date Start date
D

Dallman Ross

I have a chart that changes according to how I filter my
data. I used named ranges to achieve this. I want to
add a selection box with a list of the data I might wish
to select and view in the chart. (Then I won't have to
fumble with choosing from the autofilter list, which contains
lots of things I'm not interested in viewing or skipping past.)

I don't know how to approach doing this. Help would be
appreciated. xl 2002.

Thanks,
=dman=
 
Dallman,

I don't quite get it. I've read your post over, but can't keep my eyes going in the same
direction. You say the chart responds to the filter. So I think you're using "Plot visible
cells only" (Tools - Options - Chart) But I don't know how named ranges gets into that.
Now you want a list box from which to select data to chart. Does that have something to do
with the named ranges? Say more about what's to be in the list box, and how it relates to
the data to be charted.
--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
 
Earl Kiosterud said:
Dallman,

I don't quite get it. I've read your post over, but can't keep
my eyes going in the same direction. You say the chart responds
to the filter. So I think you're using "Plot visible cells only"
(Tools - Options - Chart) But I don't know how named ranges gets
into that. Now you want a list box from which to select data to
chart. Does that have something to do with the named ranges?
Say more about what's to be in the list box, and how it relates
to the data to be charted.

Okay, thanks for listening and trying to help, Earl. I'm sorry if
I confused things with my description. Let me try again:

Yeah, you surmised correctly that I have "Plot visible cells
only" selected under Tools / Options / Chart. Named ranges are
not important to the problem at hand, but I was simply mentioning
that I use them to keep the data ranges correct for the charts, since
I update the data frequently and the number of records changes.
But you're right: I shouldn't have bothered to mention that part.

The data is this year's realized gains from my stock trading
activities. There's a fair bit of data. I download the data as a
CSV file and import it into Excel and sort and format it just so
and combine some of the sales lots and add various calculated-field
columns so I can analyze my performance. I do this all via some
rather extensive VBA code that I spent a good deal of the last
month composing.

For viewing my charts, I mainly use the AutoFilter on the
Description column and select individual stocks. But there are
thirty or thirty-five subtotal rows interspersed with the stock
company names, and there are (so far this year) about 165 lines'
worth of option trades in the list as well -- calls and puts. I
really won't be viewing those types of items in the charts I use
most of the time, but will be concentrating on the stocks. There
are about 100 lines of data a month, but really there are only
about 35 stocks that I care to view in my charts. So these 35
company names are what will go in my List Box.

Basically, I don't want to have to scroll through the AutoFilter
list past all the other stuff to get to the items I care to view.

Hmm, here's what would go in the List Box as of COB today for 2007:
(I see the count is 34.) :-)

ACCREDITED HOME LENDERS HLDG
ADVANCED MICRO DEVICES INC
ALTERA CORP
APPLE INC
APPLIED MATERIALS INC DELAWARE
ASCENT SOLAR TECHNOLOGIES INC
AUTODESK INC
BEA SYSTEMS INC
CACHE INC NEW
CAVIUM NETWORKS INC
CHAPARRAL STEEL COMPANY
CHECK POINT SOFTWARE TECH
CHINA TECHFAITH WIRELESS
CISCO SYS INC
COMVERSE TECHNOLOGY INC-NEW
CREE INC
EMC CORP-MASS
HERCULES OFFSHORE INC
HOVNANIAN ENTERPRISES INC CL A
INTEGRATED DEVICE TECHNOLOGY
MCAFEE INC
METHODE ELECTRONICS INC
MICROSOFT CORP
NETWORK APPLIANCE INC
NVIDIA CORP
SCHLUMBERGER LTD
SOHU.COM INC
TASER INTERNATIONAL INC
TESSERA TECHNOLOGIES INC
THE9 LTD-ADR-USD
TIBCO SOFTWARE INC
TODCO CLASS A
XEROX CORP

I've never set up a List Box before and only have beginning
experience with controls in general. I've set up a couple of
command buttons before. An outline of how to proceed would be a
great start. I am gaining ground fast as a VBA coder in general,
though, so I think I'll be able to understand or figure out
whatever you throw my way.

Oh, and I am willing to set up named ranges for the particular
stocks if that makes things a lot easier. (Maybe that's why I
mentioned those before. Yeah, that must be what I was thinking.)
But basically, I'm hoping my selection from the List Box can
control the AutoFilter (or the Advanced Filter, though I've
never done much with that yet), is all.

=dman=

====================================
 
Back
Top