Need Help w/ Charting Macro


Posted by Hansoh on November 26, 2001 7:31 AM

Problem: charts in MSExcel take up lots of memory and having more than a dozen in 1 file tends to crash MSExcel.

Proposed Solution: have 1 chart that can be customized by users (i.e., intermediate-level Excel users) by choosing items in a listbox that will change which SERIES of data the chart picks up.

Objective: simple macro that populates the =SERIES(argument1, argument2, argument3) function in chart. also, the chart(s) will contain up to 2 lines/columns so macro should account for 2 =SERIES functions. (note: for simplicity sake, the example below contains just 1 column of data in chart.)

Data Array: A1:D6

welmert kmert tergat
net sales 333 222 111
gross margin 222 111 66
EBIT 111 66 33
GM%NS 67% 50% 59%
EBIT%NS 33% 30% 30%

=SERIES(Sheet1!EBIT,Sheet1!Companies,Book1!EBITdata,1)

(above formula assumes that i have defined NAMES for all the data rows so please run with that instead of cell references. thanks.)

let's say in F1, there's a small dropdown listbox (created via Data Validation or any other method) that has the list items: Gross Margin, EBIT, etc.

right now, it's selected on EBIT. if a user comes in and chooses Gross Margin, i'd like the chart to drop the EBIT series of data and pick up the Gross Margin series of data. i'm sure that this can only be done using a macro. although i'm familiar with VBA code (i.e., not proficient), i haven't gotten to the CHARTING chapters in the Power Programming with VBA book yet...so please help. i'm almost certain that the macro will contain very few lines of code.

****in exchange for your valuable time and knowledge, as a small token of my sincere appreciation, i will send a small holiday care package to the person who provides the first solution that gets me to where i need to get. thanks in advance.****


han


Posted by Bib on November 26, 2001 7:52 AM


Have you tried PivotCharts (similar to pivotTables) ? That might suit your needs...

Thanks for the travel care package ;)



Posted by Hansoh on December 02, 2001 4:32 PM

thanks, bib

bib:

thanks for your suggestion. after doing a little research re: your advice to use pivotcharts, i found out that pivotcharts are a win2000, office2000 feature. i'm have win95/office 97-8 and therefore can not use pivotcharts. if and when i get 2000, i'll be sure to take advantage of them. thanks.

han