View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.charting
ShaneDevenshire ShaneDevenshire is offline
external usenet poster
 
Posts: 2,344
Default macro for graphs

Hi,

If I understand your question you would like to change the chart by pressing
a button on the spreadsheet.

If this is what you want it doesn't require a macro. Range name your
different data ranges for the diffierent charts. For example A2:B10 would be
California, C2:D10 would be Washington data.

Set up one data area for charting. In this area create formulas like:
=INDEX(INDIRECT($I$1),ROW(A1),COLUMN(A1))

In cell I1 add a data validation dropdown with the list option selected.
Have the list be a list of the range names of each of your data areas. Copy
this formula down as many rows as your data extends and over for as many
columns. In my example I copied it down 9 rows and over for 2 columns
because that is how large the data area A2:B10 is. When I pick a state from
the Data Validation drop down the chart area updates and the chart plotted
from that are changes.

--
Cheers,
Shane Devenshire


"BNT1 via OfficeKB.com" wrote:

Hi

I have seen a sheet in a workbook that just contains buttons to run macro for
graphs. there we plenty and doubt if they were painstakenly recorded on by
one and then assigned a button.

Can anyone point me in the right direction if its possible to short cut, by
just changing ranges. All the graphs will be the same format


Thank in advance

Regards

Brian

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...chart/200701/1